Add partial support for not -- e.g. expect(xxx).not.toEqual(yyy). Old-style custom matchers not yet supported.

This commit is contained in:
Christian Williams
2009-12-24 17:01:13 -05:00
parent 20a00d517e
commit d16e2b7992
3 changed files with 84 additions and 29 deletions

View File

@@ -65,7 +65,9 @@ jasmine.Spec.prototype.addMatcherResult = function(result) {
};
jasmine.Spec.prototype.expect = function(actual) {
return new (this.getMatchersClass_())(this.env, actual, this);
var positive = new (this.getMatchersClass_())(this.env, actual, this);
positive.not = new (this.getMatchersClass_())(this.env, actual, this, true);
return positive;
};
jasmine.Spec.prototype.waits = function(timeout) {