Issue description
I'm trying to use a stubbed method in a cleanup method. This works if an assertion failed in the test, but not if the test succeeds.
How to reproduce
class UseStubInCleanupSpec extends Specification {
def mock = Mock(java.util.function.Function)
def setup() {
mock.apply("a") >> { "b" }
}
def cleanup() {
assert mock.apply("a") == "b"
}
def "run a successful test"() {
expect:
true
}
def "run a failing test"() {
expect:
false
}
}
Java/JDK
1.8
Groovy version
2.3.10:indy
Operating System
Mac
IDE
IntelliJ
Gradle/Grails
compile 'org.spockframework:spock 1.0-groovy-2.3'
Issue description
I'm trying to use a stubbed method in a cleanup method. This works if an assertion failed in the test, but not if the test succeeds.
How to reproduce
Java/JDK
1.8
Groovy version
2.3.10:indy
Operating System
Mac
IDE
Gradle/Grails