Spock Primer Peter Niederwieser, The Spock Framework TeamVersion 1.1 This chapter assumes that you have a basic knowledge of Groovy and unit testing. If you are a Java developer but haven’t heard about Groovy, don’t worry - Groovy will feel very fami…
Introduction Peter Niederwieser, The Spock Framework TeamVersion 1.1 Spock is a testing and specification framework for Java and Groovy applications. What makes it stand out from the crowd is its beautiful and highly expressive specification language…
Modules Peter Niederwieser, The Spock Framework TeamVersion 1.1 Guice Module Integration with the Guice IoC container. For examples see the specs in the codebase. Spring Module The Spring module enables integration with Spring TestContext Framework.…
Extensions Peter Niederwieser, The Spock Framework TeamVersion 1.1 Spock comes with a powerful extension mechanism, which allows to hook into a spec’s lifecycle to enrich or alter its behavior. In this chapter, we will first learn about Spock’s built…
Interaction Based Testing Peter Niederwieser, The Spock Framework TeamVersion 1.1 Interaction-based testing is a design and testing technique that emerged in the Extreme Programming (XP) community in the early 2000’s. Focusing on the behavior of obje…
Data Driven Testing Peter Niederwieser, The Spock Framework TeamVersion 1.1 Oftentimes, it is useful to exercise the same test code multiple times, with varying inputs and expected results. Spock’s data driven testing support makes this a first class…