Hello R.Goh
The creator of Spock (Peter Niederwieser) works for Gradleware (makers of the gradle build system) and he seems to be an IntelliJ fan as well.
It is my feeling that the Spock + Gradle + IntelliJ combination gets more love than the Spock + Maven + Eclipse one (which is also the one I use)
There is also a new version of Groovy 2.4.x that might break some things in Eclipse (Maven should work fine).
A new snapshot of Spock was released as well. I am currently evaluating the changes.
However I just checked my Eclipse installation and I can run all tests (Spock and JUnit) when I right-click on the project and select Run as -> JUnit test
Can you try to run each Spock test individually? Can you click for example on AdderSpec.groovy file and run it as JUnit? Does the file have the Groovy icon?
It is a bit hard to diagnose your Eclipse installation without some more details. The common trick that most people miss in Eclipse (and Spock) is that you have
to make sure that Spock tests are added as a source folder as well.
To do this
1)Right click on chapter 1 folder in the "Project Explorer" window and select properties
2)Choose the "Java build path" setting
3)Click the button "Add Folder..."
4)Make sure that src/test/groovy is also checked (and click on it if it is not)
In the next MEAP I will expand on the appendix chapter to give even more details about Spock installation and usage.
The second issue that you mention - Plugin execution not covered by lifecycle configuration: org.codehaus.gmaven:gmaven-plugin:1.4:compile (execution: default, phase: compile) is normal and expected. I have it as well but I don't see any side effect.
Kostis
|