Skip to content

Instantly share code, notes, and snippets.

Created February 24, 2017 06:01
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 anonymous/c255ede3b77cdc2d2c844f4e0aa16627 to your computer and use it in GitHub Desktop.
Save anonymous/c255ede3b77cdc2d2c844f4e0aa16627 to your computer and use it in GitHub Desktop.
def "myMethod without arguments has side effect 1" {
when:
myMethod()
then:
// assert side effect 1
}
def "myMethod without arguments has side effect 2" {
when:
myMethod()
then:
// assert side effect 2
}
def "myMethod without arguments throws an exception when something" {
given:
// some bad state
when:
myMethod()
then:
thrown SomeException
}
def "myMethod with arguments has side effect 1" {
when:
myMethod("some string")
then:
// assert side effect 1
}
def "myMethod with arguments has side effect 2" {
when:
myMethod("some string")
then:
// assert side effect 2
}
def "myMethod with arguments throws an exception when something" {
given:
// some bad state
when:
myMethod("some string")
then:
thrown SomeException
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment