I'm trying to write functional test with Spock and Geb. I want to use in one test method multiple blocks of when/then with where for each block. Is it possible? Or I should use one where for all the when/then?
You will not be able to use where
per interaction, it would complain about the usage. You would end up with a single where
for multiple interactions. Follow this as a sample:
def test() {
given:
def c
def d
when:
c = a + b
then:
c == result
when:
d = e - f
then:
d == res
where:
a | b |result | e |f |res
1 | 2 | 3 | 7 |5 |2
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With