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. |
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
.
Integration with the Tapestry5 IoC container. Please add dependency org.spockframework:spock-tapestry
to your project. For examples see the specs in the
codebase.
Integration with the Unitils library. Please add dependency org.spockframework:spock-unitils
to your project. For examples see the specs in the
codebase.
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. |