Created

Embed URL

HTTPS clone URL

SSH clone URL

You can clone with HTTPS or SSH.

Download Gist

A Spock unit test to validade a simple division method

View CalculatorSpec.groovy
1 2 3 4 5 6 7 8 9 10 11 12
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
Something went wrong with that request. Please try again.