Running a single test using the Geb/Spock Framework

58 views
Skip to first unread message

bpilati

unread,
Feb 24, 2011, 11:20:42 AM2/24/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: http://spock-framework.3207229.n2.nabble.com/Running-a-single-test-using-the-Geb-Spock-Framework-tp6060916p6060916.html
Sent from the Spock Framework mailing list archive at Nabble.com.

dsommerville

unread,
Mar 17, 2011, 5:46:26 AM3/17/11
to spockfr...@googlegroups.com
Hi Brian - this looks like Grails-related question, rather than Groovy (based
on the "test-app")?

If so, this might not be the best forum for the question - however, you need
to ensure that your specification ends with "Spec", rather than "Test" and
that it exists in the right directory - for example, create the following in
the "test/functional" directory:

class ExampleSpec extends GebSpec {
def "example test"() {
when: "stimulus"
then: "response"
}
}

If you meet these two conditions, then the test above should run and pass as
is, when you execute the following (assuming you have the spock and geb
plugins installed on your project):

grails test-app functional:

--
View this message in context: http://spock-framework.3207229.n2.nabble.com/Running-a-single-test-using-the-Geb-Spock-Framework-tp6060916p6180234.html

Reply all
Reply to author
Forward
0 new messages