Skip to content

Instantly share code, notes, and snippets.

@robashton
Forked from hhariri/gist:3879379
Created October 12, 2012 14:24
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 robashton/3879435 to your computer and use it in GitHub Desktop.
Save robashton/3879435 to your computer and use it in GitHub Desktop.
package samples
import kspec.framework.*
spec public fun calculatorSpecs() {
var calculator = null
var sum = 0
given("a calculator", {
calculator = Calculator()
})
when("calling sum with two numbers", {
sum = calculator.sum(2,4)
})
then("it should return the result of adding the first number to the second", {
shouldEqual(6, sum)
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment