Skip to content

Instantly share code, notes, and snippets.

@mariomelo
Created May 10, 2013 13:32
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 mariomelo/5554402 to your computer and use it in GitHub Desktop.
Save mariomelo/5554402 to your computer and use it in GitHub Desktop.
A Spock unit test to validade a simple division method
when: "I divide a number by another"
def result = controller.divide firstNumber, secondNumber
then: "I should get the correct value"
result == expectedResult
where: "The values are as following"
firstNumber | secondNumber | expectedResult
10 | 5 | 2
36 | 6 | 6
-10 | -1 | 10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment