fspyckerelle (11) [Avatar] Offline
mvn test
on chapter 3 ran well.
But when I issued
gradle test
, it failed on 1 test.

34 tests completed, 1 failed
:test FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':test'.
> There were failing tests. See the report at: file:... java-testing-with-spock-master/cha

Attached files
1) OneFailingTestWithGradleTest.log capture of the output)
2) the build/reports/tests/index.html file
3) the bulld/reports/tests/classes/com.manning.spock.chapter3.coolant.CoolantSensorSpec.html file
Kostis Kapelonis (63) [Avatar] Offline

The gradle build file is experimental. I used it for Spock reports that present a nice result for Spock tests (including given-when-then labels).
The expected way of building code samples is Maven.

However I found the problem and fixed it for you!

I just pushed the fix so feel free to verify. Note however that in the future I might delete the gradle file completely to keep things simpler for readers.

Kostis Kapelonis (63) [Avatar] Offline
The gradle file in chapter 3 was removed. Maven is used for all chapters.