Spock is a developer testing framework for Java and Groovy applications. Even though it is fully JUnit-compatible on the outside, Spock isn't just another JUnit clone - its goal is to take developer testing to the next level! With its Groovy-powered and highly expressive testing language, Spock boosts productivity and brings back the fun to testing.
In the first part of this session, Spock's approach to state-based, data-driven, and behavior-based testing will be demonstrated. Next, we will explore some of Spock's extensions, in particular the Grails plugin and the Spring TestContext Framework integration. Finally, we will look under the covers of Spock and write our own extension. Along the way, expect to see lots of code and live demos.
So you already know and love Spock, the Enterprise ready testing framework, but want to know how to make the most of it and take your testing to the next level? Then this talk is for you. Even if you're new to Spock, but are interested in making your testing more effective this talk is for you.
We'll start with how the combination of Spock and the Groovy language makes it easy to bring the concept of “executable specifications” to the realm of unit testing, without the ceremony but with all of the benefits, and why this is so important to the health of your system.
From there we'll discuss extending Spock through its own Extension API and support for JUnit rules, which is one way to make your tests much more expressive and maintainable.
We'll close with Spock's seamless integration with Grails 2.0, and some hidden Spock treasures that help you get even more out of your testing.