Skip to content

Instantly share code, notes, and snippets.

@giginet
Created December 22, 2011 07:54
Show Gist options
  • Select an option

  • Save giginet/1509441 to your computer and use it in GitHub Desktop.

Select an option

Save giginet/1509441 to your computer and use it in GitHub Desktop.
exports.testCalc = {
setUp : (callback) ->
@x = 10
@y = 20
callback()
tearDown : (callback) ->
callback()
testSum : (test) ->
sum = @x + @y
test.equal(sum, 30)
test.done()
testSub : (test) ->
sub = @x - @y
test.equal(sub, -10)
test.done()
testMul : (test) ->
mul = @x * @y
test.equal(mul, 200)
test.done()
testDiv : (test) ->
div = @x / @y
test.equal(div, 0.5)
test.done()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment