Skip to content

Files

Latest commit

 

History

History
43 lines (23 loc) · 2.33 KB

modules.adoc

File metadata and controls

43 lines (23 loc) · 2.33 KB

Modules

JUnit 4 Module

Integration with JUnit 4 features for Spock 2+ (which internally uses JUnit Platform - part of JUnit 5). Please add dependency org.spockframework:spock-junit4 to your project.

The module is required for:

  • running JUnit 4 rules and class ruless (@Rule/@ClassRule)

  • using JUnit 4’s test fixture annotations (@BeforeClass, @Before, @After, @AfterClass)

Note
This module does its best to support old features from JUnit 4, however, users are encouraged to migrate to the native Spock counterparts.

Guice Module

Integration with the Guice IoC container. Please add dependency org.spockframework:spock-guice to your project. For examples see the specs in the codebase.

With Spock 1.2+ detached mocks are automatically attached to the Specification if they are injected via @Inject.

Tapestry Module

Integration with the Tapestry5 IoC container. Please add dependency org.spockframework:spock-tapestry to your project. For examples see the specs in the codebase.

Unitils Module

Integration with the Unitils library. Please add dependency org.spockframework:spock-unitils to your project. For examples see the specs in the codebase.

Grails Module

The Grails plugin has moved to its own GitHub project. It has legacy status and was last released for Spock 0.7 and Groovy versions 1.8 and 2.0, because it is no longer necessary.

Note
Grails 2.3 and higher have built-in Spock support and do not require a plugin.