Run single Spock test in Grails

When using Spock framework together with Intellij Idea 11 I found very annoying that when I try to run single test all test in spec are executed.
First I thought that this is Idea issue but it turned out to be Grails problem.

The thing is that You can only run whole spec from Grails command line:

grails test-app unit:spock SomeControllerSpec

New Feature request to fix this:


There is a annotation you can use as a workaround to run only one test:

def "should test something"() {

You can put this on test you are working on to prevent all other test in spec from running.
Don’t forget to remove it when You finish.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s