jtanistra / spock

Automatically exported from code.google.com/p/spock
0 stars 0 forks source link

Tests are not executed with Maven 3 #202

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem? If possible, provide source code and
stack trace.

Run the attached project with maven 3. 

Expected output:
 Tests run: 1, Failures: 0, Errors: 0, Skipped: 0
Actual output:
 Tests run: 0, Failures: 0, Errors: 0, Skipped: 0,

What version of Spock and Groovy are you using?
spock: 0.5-groovy-1.7, groovy: 1.7.5

Please provide any additional information below. You can also assign
labels.

When I first tried to use spock with maven3 it said that I have to remove the 
spock plugin from the test and use the standard surefire test name conventions. 
I did so, but it still doesn't work. Surefire recognizes the test, but no test 
method is executed.

In the surefire report directory there is 

-------------------------------------------------------------------------------
Test set: spocktest.SpockTest
-------------------------------------------------------------------------------
Tests run: 0, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.2 sec

Original issue reported on code.google.com by m.magy...@gmail.com on 19 Sep 2011 at 10:30

GoogleCodeExporter commented 8 years ago
Forgot the attach the project:

Original comment by m.magy...@gmail.com on 19 Sep 2011 at 10:31

Attachments:

GoogleCodeExporter commented 8 years ago
Additional info:
If I remove the "extends Specification", and add a @Test annotation to the test 
method, it will be executed correctly.

Original comment by m.magy...@gmail.com on 19 Sep 2011 at 10:32

GoogleCodeExporter commented 8 years ago
It looks like, it was my fault. If there is no spock block in the test method 
then nothing will happen. If I insert an expect/where block, it will work fine.

Original comment by m.magy...@gmail.com on 19 Sep 2011 at 10:46

GoogleCodeExporter commented 8 years ago
Yes, that's what defines a test method in Spock. It has to have at least one 
labeled block like setup:, expect:, etc.

Original comment by pnied...@gmail.com on 20 Sep 2011 at 12:15