This screencast demonstrates how to create Spock testing specifications. It covers creating basic when/then blocks, given/when/then blocks, expect/where blocks, and data tables. It explains how to create Spock file templates and Spock Live Templates for IDEA.
Here are some useful links to read for this webcast:
- Spock Framework - http://code.google.com/p/spock/
- IDEA File Templates - http://www.jetbrains.com/idea/webhelp/file-templates.html
- IDEA Live Templates - http://www.jetbrains.com/idea/webhelp/live-templates.html
To work with Spock, I use one file template and three live templates.
My file template creates a Spock Specification with the correct java package and javadoc:
My first Live Template is the when-then template:
The second template is the given/when/then template:
The last template is the expect/where template:
I've made a lot of screencasts and blog posts over the years. If you like this, then there are many ways to see the other stuff I've done:
- My main blog: http://hamletdarcy.blogspot.com
- My other JetBrains.tv posts: http://tv.jetbrains.net/tags/hamlet
- IDEA related posts on my blog: http://hamletdarcy.blogspot.com/search/label/IDEA
- My screencasts on YouTube: http://www.youtube.com/user/HamletDRC
- IDEA related Posts on my work blog: http://www.canoo.com/blog/tag/idea/
- Or follow me on Twitter: @HamletDRC
Phew, that's a lot of self-promotion :)
Thanks for watching, and leave a comment!
»


