Merge pull request #254 from jcracknell/nan-matcher

Added toBeNaN matcher
This commit is contained in:
Rajan Agaskar
2012-10-05 17:31:36 -07:00
3 changed files with 45 additions and 0 deletions

View File

@@ -150,6 +150,17 @@ jasmine.Matchers.prototype.toBeNull = function() {
return (this.actual === null);
};
/**
* Matcher that compares the actual to NaN.
*/
jasmine.Matchers.prototype.toBeNaN = function() {
this.message = function() {
return [ "Expected " + jasmine.pp(this.actual) + " to be NaN." ];
};
return (this.actual !== this.actual);
};
/**
* Matcher that boolean not-nots the actual.
*/