Custom matchers may now work like regular matchers -- just return a boolean, don't call this.report(). The old style still works but is deprecated.

This commit is contained in:
Christian Williams
2009-12-24 12:15:18 -05:00
parent b99bd08df9
commit 9f247eb278
4 changed files with 90 additions and 9 deletions

View File

@@ -26,10 +26,7 @@ jasmine.Env = function() {
};
jasmine.util.inherit(this.matchersClass, jasmine.Matchers);
for (var methodName in jasmine.Matchers.prototype) {
var orig = jasmine.Matchers.prototype[methodName];
this.matchersClass.prototype[methodName] = jasmine.Matchers.matcherFn_(methodName, orig);
}
jasmine.Matchers.wrapInto_(jasmine.Matchers.prototype, this.matchersClass);
};