Package spock.lang
Annotation Type TempDir
@Beta @Retention(RUNTIME) @Target(FIELD) public @interface TempDir
Generate a temp directory for test, and delete it after test.
@TempDir
can be applied to annotate a member field of type File
, Path
or untyped like def
in a spec class (untyped field will be injected with Path
). If the annotated field is shared,
the temp directory will be shared in this spec, otherwise every iteration will have its own temp directory.
- Since:
- 2.0