Created
August 13, 2012 00:13
-
-
Save rconnelly/3335637 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
var vows = require('vows'), | |
assert = require('assert'); | |
// Create a Test Suite | |
vows.describe('Divide and Multiply').addBatch({ | |
'when multiplying 2 by 2': { // Context (batch 1) | |
topic: function () { return 2 * 2; }, | |
'we get four': function (topic) { // Vow w/Topic arg | |
assert.equal (topic, 4); // Async | |
} | |
}, | |
'but when dividing two by two': { // Context (batch 2) | |
topic: function () { return 2 / 2 }, | |
'we get one': { // Sub-Context | |
'is not a number': function (topic) { | |
assert.equal(topic, 1) | |
}, | |
'is not equal to four': function (topic) { | |
assert.notEqual (topic, 4); | |
} | |
} | |
} | |
}).export(module); // use with testrunner | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment