Skip to content

Instantly share code, notes, and snippets.

@fmamud
Created October 14, 2016 04:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fmamud/9f9b3ac0de3c4a634e5b28fe00466202 to your computer and use it in GitHub Desktop.
Save fmamud/9f9b3ac0de3c4a634e5b28fe00466202 to your computer and use it in GitHub Desktop.
Stubbing many returns in Spock Specification
import spock.lang.*
class MySpec extends Specification {
def "should return 1,2,3 respectively when calling size list"() {
given:
List list = Stub()
list.size() >>> [1,2,3]
expect:
1 == list.size()
2 == list.size()
3 == list.size()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment