djcrankypants / spock

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

Option for running tests in a single spec #293

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Provide a method for running a single spec, or even a single package, from the 
command line. Something similar to Grails' `test-app ExampleService` would be 
very useful by allowing developers to quickly run a test in a single spec 
rather than having to @Ignore the tests they do not want to run.

Original issue reported on code.google.com by poorg...@gmail.com on 14 Jan 2013 at 6:12

GoogleCodeExporter commented 8 years ago
What's the use case? Typically this is taken care of by the build tool (Grails, 
Gradle, Maven, etc.). You could also use the JUnit command-line runner.

Original comment by pnied...@gmail.com on 14 Jan 2013 at 6:15

GoogleCodeExporter commented 8 years ago
I entered this issue after finding the following thread in the google group but 
no issue entered into the tracker. 
https://groups.google.com/forum/#!topic/spockframework/by9zHG4cE2M/discussion

In my particular case I want to run a single spec via Gradle.

Original comment by poorg...@gmail.com on 16 Jan 2013 at 5:11

GoogleCodeExporter commented 8 years ago
> In my particular case I want to run a single spec via Gradle.

This is accomplished as follows: `gradle [testTask] 
-D[testTask].single=[className]`

Example: `gradle test -Dtest.single=MySpec`

The same should work for packages (although I haven't tried).

Providing its own command line runner is currently out of scope for Spock, so 
I'll close this issue.

Original comment by pnied...@gmail.com on 25 Jan 2013 at 1:15