The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

fspyckerelle (11) [Avatar] Offline
#1
Running
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
pter3/build/reports/tests/index.html




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
#2
Hello

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
Kostis Kapelonis (63) [Avatar] Offline
#3
The gradle file in chapter 3 was removed. Maven is used for all chapters.