Getting Started with Spock and Groovy

Posted 15.04.11 19:04 by Hamlet D'Arcy
24,278
English
IntelliJ IDEA Groovy, hamlet, intellij, Spock

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:

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: 

idea file template

My first Live Template is the when-then template: 

when then

The second template is the given/when/then template: 

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: 

Phew, that's a lot of self-promotion :)

Thanks for watching, and leave a comment! 

»
Your rating: None Average: 5 (5 votes)