Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JUnit4 assumptions fail the tests when coming from setup() method of a super spec #1263

Closed
rieske opened this issue Jan 21, 2021 · 0 comments · Fixed by #1264
Closed

JUnit4 assumptions fail the tests when coming from setup() method of a super spec #1263

rieske opened this issue Jan 21, 2021 · 0 comments · Fixed by #1264

Comments

@rieske
Copy link
Contributor

rieske commented Jan 21, 2021

Issue description

JUnit4 assumptions fail the tests when coming from setup() method of a super spec.
When debugging, it looks like the MethodInfo of the setup method does not have any interceptors in the failing case. Specifically, the ExceptionAdapterInterceptor that handles this case in the working case is missing.

How to reproduce

Repository with minimal reproducer: https://github.com/rieske/spock-junit4-assumptions-reproducer

Assumptions are handled correctly when this spec is executed:

class SuperSpec extends Specification {
    def setup() {
        assumeTrue(false)
    }

    def "super feature"() {
        expect:
        true
    }
}

Assumptions from super spec's setup() method fail as errors when this one is executed:

class SubSpec extends SuperSpec {
    def "sub feature"() {
        expect:
        true
    }
}

Build-tool dependencies used

testImplementation("org.spockframework:spock-core:2.0-M4-groovy-2.5")
testImplementation("org.spockframework:spock-junit4:2.0-M4-groovy-2.5")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant