Skip to content

Instantly share code, notes, and snippets.

@robfletcher
Created August 12, 2010 20:36
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save robfletcher/521675 to your computer and use it in GitHub Desktop.
Save robfletcher/521675 to your computer and use it in GitHub Desktop.
eventDefaultStart = {
createUnitTest = { Map args = [:] ->
def superClass
// map unit test superclass to Spock equivalent
switch(args["superClass"]) {
case "ControllerUnitTestCase":
superClass = "ControllerSpec"
break
case "TagLibUnitTestCase":
superClass = "TagLibSpec"
break
default:
superClass = "UnitSpec"
}
createArtifact name: args["name"], suffix: "${args['suffix']}Spec", type: "Spec", path: "test/unit", superClass: superClass
}
}
@artifact.package@import spock.lang.*
import grails.plugin.spock.*
class @artifact.name@ extends @artifact.superclass@ {
def "feature method"() {
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment