Created
November 3, 2011 14:53
-
-
Save ragaskar/1336695 to your computer and use it in GitHub Desktop.
Fuzzy output matcher (untested)
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
beforeEach(function() { | |
this.addMatchers({ | |
toEqualSomethingIn : function toEqualSomethingIn(possibleOutputs) { | |
this.message = function() { | |
return [ | |
"Expected " + this.actual + " to be one of the following: "+ possibleOutputs, | |
"Expected " + this.actual + " not to be one of the following: "+ possibleOutputs + ", but it was" | |
]; | |
}; | |
return (possibleOutputs.indexOf(this.actual) != -1) | |
}, | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment