Skip to content

Instantly share code, notes, and snippets.

@aaroncox
Created May 23, 2013 21:28
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 aaroncox/5639562 to your computer and use it in GitHub Desktop.
Save aaroncox/5639562 to your computer and use it in GitHub Desktop.
Testing ParseItems
suite("parseItems >", function() {
var testData = require('./data/parseItems');
setup(function() {
this.calc = new Calc();
});
_.each(testData, function(testCase) {
suite(testCase.name + " >", function() {
setup(function() {
this.calc.setBuild(testCase.given);
this.calc.run();
});
teardown(function() {
this.calc.reset();
});
_.each(testCase.expected, function(expected, attr) {
test(attr + " is correct (" + expected + ")", function() {
assert.equal(expected, this.calc.attrs[attr]);
});
});
});
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment