This message was deleted.
# plugin-development
s
This message was deleted.
c
that’s what GradleRunner is for - output debug/info messages as appropriate and assert on those.
t
ProjectInternal
has an
evaluate()
method, that's used in some of Gradle's own tests; but I'm not sure you should rely on it for your own tests.
GradleRunner
would be much safer, albeit much heavier too.
g
I used
ProjectInternal#evaluate()
to test some things that happen in
afterEvaluate
but it could be fragile
g
I see. For tests like these with GradleRunner, you'd add that logic to the build.gradle or is there a more elegant way?
g
I just use println in settings/build.gradle.kts and/or tasks that output info required for verification in some simple semi-structured format (like tab/pipe-separated values) with fixed prefix to filter then from stdout with more complex values just serialised with jackson in that tsv/psv. And than anything you want for structured assertions (like assertj, assertk etc)
IIRC Vampire also recommended spock framework, it's quite handy for parameterized tests and nice human-readable assertions in test methods themselves