Issue description
The @TempDir doesn't work in base class.
How to reproduce
Given a build.gradle file:
plugins {
id 'groovy'
}
repositories {
mavenCentral()
}
dependencies {
testImplementation 'org.spockframework:spock-core:2.0-M4-groovy-2.5'
}
test {
useJUnitPlatform()
}
and a src/test/groovy/BaseSpec.groovy file:
import spock.lang.Specification
import spock.lang.TempDir
import java.nio.file.Path
class BaseSpec extends Specification {
@TempDir Path tmp
}
and a src/test/groovy/FileSpec.groovy file:
class FileSpec extends BaseSpec {
void "test"() {
expect:
tmp != null
}
}
when the test is executed
then it fails
Condition not satisfied:
tmp != null
| |
| false
null
Versions
- Spock 2.0-M4
- Gradle 6.7
- Java 11
openjdk version "11.0.9" 2020-10-20 LTS
OpenJDK Runtime Environment Zulu11.43+21-CA (build 11.0.9+11-LTS)
OpenJDK 64-Bit Server VM Zulu11.43+21-CA (build 11.0.9+11-LTS, mixed mode)
- Groovy 2.5.12 (from transitive dependencies of Spock)
- IntelliJ IDEA, but also reproduced in command line
- macOS 10.15.7
Issue description
The
@TempDirdoesn't work in base class.How to reproduce
Given a
build.gradlefile:plugins { id 'groovy' } repositories { mavenCentral() } dependencies { testImplementation 'org.spockframework:spock-core:2.0-M4-groovy-2.5' } test { useJUnitPlatform() }and a
src/test/groovy/BaseSpec.groovyfile:and a
src/test/groovy/FileSpec.groovyfile:when the test is executed
gradle testthen it fails
Versions