samedi 15 août 2020

Spockframework soft assertion describes only first fail

Spockframework offers soft assertions mechanism, but it seems it doesn't work properly (at least in my configuration).

I have created simplest test:

verifyAll {
    1 == 2
    2 == 3
}

I expect to see two failure message, but I see only first one:

Condition not satisfied:

1 == 2
  |
  false

Second one is also executed, but it appears only in gradle report:

org.example.SoftAssertionsTest > simplest test FAILED
    org.spockframework.runtime.SpockComparisonFailure at SoftAssertionsTest.groovy:9
    org.spockframework.runtime.SpockComparisonFailure at SoftAssertionsTest.groovy:10

Versions:

compile 'org.codehaus.groovy:groovy-all:2.5.8'
testCompile group: 'junit', name: 'junit', version: '4.12'

testImplementation("org.springframework.boot:spring-boot-starter-test:2.+")
testImplementation('org.spockframework:spock-spring:1.3-groovy-2.5')

I have pushed this example to: https://github.com/fergus-macdubh/spock-soft-assertions

Is there a way to make it show ALL messages?

Aucun commentaire:

Enregistrer un commentaire