Skip to content

Instantly share code, notes, and snippets.

@ian-ellis
Created January 16, 2017 22:28
Show Gist options
  • Save ian-ellis/41bdb4bf9b1adba27c776611b41ab967 to your computer and use it in GitHub Desktop.
Save ian-ellis/41bdb4bf9b1adba27c776611b41ab967 to your computer and use it in GitHub Desktop.
Simple Addition Spock Specification to demonstrate syntax
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