Skip to content

Instantly share code, notes, and snippets.

View mariomelo's full-sized avatar

Mário Melo mariomelo

View GitHub Profile
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.0/install.sh | bash
def divide(firstNumber, secondNumber) {
if(secondNumber != 0)
firstNumber / secondNumber
else
'Infinite'
}
@mariomelo
mariomelo / CalculatorSpec.groovy
Created May 10, 2013 13:32
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