Added toBeNaN matcher

This commit is contained in:
James Cracknell
2012-07-12 19:14:13 -06:00
committed by Davis W. Frank & Rajan Agaskar
parent acdc497361
commit ac55e26870
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.
*/