where
OR
, , :
where:
a | b | c
1 | 0 | 1
2 | 2 | 2
4 | 5 | 5
:
where:
a << [1, 2, 4]
b << [0, 2, 5]
c << [1, 2, 5]
, ( . org.spockframework.compiler.WhereBlockRewriter
). var << list
" " .
, Spock 1.1, , "Multi-Variable Data Pipes", :
class SampleTest extends Specification {
@Unroll
def "max of #a and #b gives #c"() {
expect:
Math.max(a, b) == c
where:
[a, b, c] << dataTable()
}
static def dataTable() {
[
[1, 0, 1],
[2, 2, 2],
[4, 5, 5]
]
}
}
: docs , , OR
, -
where:
a | b || c
1 | 0 || 1
2 | 2 || 2
4 | 5 || 5