Created
October 14, 2016 04:57
-
-
Save fmamud/9f9b3ac0de3c4a634e5b28fe00466202 to your computer and use it in GitHub Desktop.
Stubbing many returns in Spock Specification
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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