Files
jasmine/src/core/matchers/toMatch.js
Kyriacos Souroullas and Sheel Choksi e346e7dcc1 Revert removal of compare nesting
Since we want the user to be able to pass a negative comparison function, the extra layer of wrapping is now needed
2013-10-28 17:13:09 -07:00

17 lines
276 B
JavaScript

getJasmineRequireObj().toMatch = function() {
function toMatch() {
return {
compare: function(actual, expected) {
var regexp = new RegExp(expected);
return {
pass: regexp.test(actual)
};
}
};
}
return toMatch;
};