Created
January 23, 2011 00:49
-
-
Save deedubs/791685 to your computer and use it in GitHub Desktop.
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
// division-by-zero-test.js | |
var vows = require('vows'), | |
assert = require('assert'); | |
// Create a Test Suite | |
vows.describe('Division by Zero').addBatch({ | |
'when dividing a number by zero': { | |
topic: function () { return 42 / 0 }, | |
'we get Infinity': function (topic) { | |
assert.equal (topic, Infinity); | |
} | |
}, | |
'but when dividing zero by zero': { | |
topic: function () { return 0 / 0 }, | |
'we get a value which': { | |
'is not a number': function (topic) { | |
assert.isNaN (topic); | |
}, | |
'is not equal to itself': function (topic) { | |
assert.notEqual (topic, topic); | |
} | |
} | |
} | |
}).run(); // Run it |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment