Reputation: 5689
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?
Upvotes: 9
Views: 10268
Reputation: 50245
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
}
Upvotes: 14