Created
July 5, 2012 15:19
-
-
Save dharFr/3054321 to your computer and use it in GitHub Desktop.
Sublime Text 2 snippet for basic 'when/then' Grails Spock test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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