Created
January 16, 2017 22:28
-
-
Save ian-ellis/41bdb4bf9b1adba27c776611b41ab967 to your computer and use it in GitHub Desktop.
Simple Addition Spock Specification to demonstrate syntax
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
package com.theiconic.spockexamples | |
import spock.lang.Specification | |
class SimpleAdditionSpec extends Specification { | |
def 'addition'() { | |
given: 'two integers' | |
def a = 1 | |
def b = 2 | |
when: 'we add them together' | |
def c = a + b | |
then: 'the result is the sum of the two' | |
c == 3 | |
when: 'we increment the result' | |
c ++ | |
then: 'it is incremented' | |
c == 4 | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment