Closed avenue68 closed 2 months ago
I believe you shouldn't use @Unroll
anymore, as that's the default.
I think you can achieve the same result by just using #var
variables in the method name itself:
import spock.lang.Specification
class MySpecification extends Specification {
def "My feature: value=#value"() {
expect:
value
where:
value << [1, 2, 3]
}
}
I know the feature method name supports unrolling by default but I wanted to represent the feature and its examples respectively.
But it seems better to make method name represent feature without @Unroll
and given
, when
, then
blocks represent examples with variables.
Fortunately your solution let each blocks have variables in them.
Thank you for replying!
Is it possible to have the string passed
@Unroll
annotation with test method name? Like in IntelliJ IDEA, the reports are shown with both test method name and unrolled examples like bellow.But the generated reports by spock-reports only include feature names like
My feature1[1]
.