Skip to content

Instantly share code, notes, and snippets.

@megoth
Created February 21, 2012 12:40
Show Gist options
  • Save megoth/1876307 to your computer and use it in GitHub Desktop.
Save megoth/1876307 to your computer and use it in GitHub Desktop.
Buster.JS: Exception-bug (not in this case though...)
var testable = function(arg) {
if(!arg) {
throw new Error("Input not valid");
}
return arg;
};
buster.testCase("Buster.JS Exception no work", {
"testable can be called": function() {
assert.defined(testable);
},
"testable doesn't allow no arg's": function() {
assert.exception(function() {
testable();
});
},
"testable allows strings": function() {
var t = testable("test");
assert.equals(t, "test");
},
"testable doesn't allow arrays": function() {
assert.exception(function() {
testable([]);
});
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment