Created
February 21, 2012 12:40
-
-
Save megoth/1876307 to your computer and use it in GitHub Desktop.
Buster.JS: Exception-bug (not in this case though...)
This file contains 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 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