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: http://jira.grails.org/browse/GPSPOCK-3

Workaround

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

@IgnoreRest
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.

Unit testing with Spock in Intellij Idea

Recently i have stared to learn Grails for my new project. For unit testing I use Spock. Unfortuantelly it turns out that test classes generated from Grails are using Junit by default.
Untill I find way to make Grails generate test with Spock template I have created file templates and live templates for Idea for generating test classes and test methods for Spock.

Spock Contoller Test File Template

#if (${PACKAGE_NAME} != "")package ${PACKAGE_NAME};#end

import grails.plugin.spock.ExtendedControllerSpec

#parse("File Header.java")
class ${NAME} extends ExtendedControllerSpec{

}

Spock Unit Test File Template

#if (${PACKAGE_NAME} != "")package ${PACKAGE_NAME};#end

import grails.plugin.spock.UnitSpec

#parse("File Header.java")
class ${NAME} extends UnitSpec{

}

Live template for given-when-then test method

def "$NAME$"(){
    given:
    $END$

    when:

    then:
}

Live template for expect-where test method

def "$NAME$"(){
    expect:
    $END$

    where:
    
}