Running a single test using the Geb/Spock Framework

2,355 views
Skip to first unread message

bpilati

unread,
Feb 28, 2011, 11:17:47 AM2/28/11
to spockfr...@googlegroups.com
Can a single test be run using the Geb/Spock Framework in Groovy?

I have tried passing these parameters from the command line without any luck:

test-app functional:<name of test>

I have also tried

test-app functional: -Dtest=<name of test>

Thanks,
Brian


View this message in context: Running a single test using the Geb/Spock Framework
Sent from the Spock Framework mailing list archive at Nabble.com.

Tomas Lin

unread,
Feb 28, 2011, 1:32:09 PM2/28/11
to spockfr...@googlegroups.com
Not sure if you can run them directly in Spock command line ( or the
syntax ), but if you configure them to be ran by the JUnit runner in
your IntelliJ projects, you can right click and run individual tests -
it uses the syntax "com.mypackage.mySpec,name of my spock test"

http://stateyourbizness.blogspot.com/2011/02/remote-controlled-gebspock-functional.html

> --
> You received this message because you are subscribed to the Google Groups
> "Spock Framework - User" group.
> To post to this group, send email to spockfr...@googlegroups.com.
> To unsubscribe from this group, send email to
> spockframewor...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/spockframework?hl=en.
>

Peter Niederwieser

unread,
Feb 28, 2011, 1:43:34 PM2/28/11
to spockfr...@googlegroups.com
On 28.02.2011, at 17:17, bpilati wrote:

> Can a single test be run using the Geb/Spock Framework in Groovy?

From the Grails command-line, you can run a single test class as explained in the Grails documentation, e.g.:

grails test-app functional: FooSpec // note the space between 'functional:' and 'FooSpec'

Not sure if you can run a single test method from the Grails command-line. What works in every environment is to temporarily annotate the method to be run with @spock.lang.IgnoreRest.

Cheers,
Peter


Luke Daley

unread,
Feb 28, 2011, 7:10:49 PM2/28/11
to spockfr...@googlegroups.com

The spock-grails plugin doesn't currently support running a single test method like the JUnit support in Grails does.

If you'd like to see this supported, please raise an enhancement request @ http://issues.spockframework.org

Reply all
Reply to author
Forward
0 new messages