Skip to content

Instantly share code, notes, and snippets.

@ragaskar
Created November 3, 2011 14:53
Show Gist options
  • Save ragaskar/1336695 to your computer and use it in GitHub Desktop.
Save ragaskar/1336695 to your computer and use it in GitHub Desktop.
Fuzzy output matcher (untested)
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