Skip to content

Instantly share code, notes, and snippets.

@dharFr
Created July 5, 2012 15:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dharFr/3054321 to your computer and use it in GitHub Desktop.
Save dharFr/3054321 to your computer and use it in GitHub Desktop.
Sublime Text 2 snippet for basic 'when/then' Grails Spock test
<snippet>
<content><![CDATA[
def "${1:name your test}"() {
setup:
// setup your test
def l = [1, 2, 3]
when:
// test something
def r = l.findAll {it > 2}
then:
// Is it correct?
r == [3]
}
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>spock</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<scope>source.groovy</scope>
</snippet>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment