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

@@ -98,9 +98,7 @@ jasmine.Spec.prototype.addMatchers = function(matchersPrototype) {
parent.apply(this, arguments);
};
jasmine.util.inherit(newMatchersClass, parent);
for (var method in matchersPrototype) {
newMatchersClass.prototype[method] = matchersPrototype[method];
}
jasmine.Matchers.wrapInto_(matchersPrototype, newMatchersClass);
this.matchersClass = newMatchersClass;
};