Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions lib/jasmine-node/jasmine-1.3.1.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,22 @@ jasmine.unimplementedMethod_ = function() {
*/
jasmine.undefined = jasmine.___undefined___;

/**
* Use <code>jasmine.POSITIVE_INFINITY</code> instead of <code>Infinity</code>, since <code>Infinity</code> is just
* a plain old variable and may be redefined by somebody else.
*
* @private
*/
jasmine.POSITIVE_INFINITY = Infinity;

/**
* Use <code>jasmine.NEGATIVE_INFINITY</code> instead of <code>-Infinity</code>, since <code>-Infinity</code> is just
* a plain old variable and may be redefined by somebody else.
*
* @private
*/
jasmine.NEGATIVE_INFINITY = -Infinity;

/**
* Show diagnostic messages in the console if set to true
*
Expand Down Expand Up @@ -1414,6 +1430,28 @@ jasmine.Matchers.prototype.toBeNaN = function() {
return (this.actual !== this.actual);
};

/**
* Matcher that compares the actual to Infinity.
*/
jasmine.Matchers.prototype.toBePositiveInfinity = function() {
this.message = function() {
return [ "Expected " + jasmine.pp(this.actual) + " to be Infinity." ];
};

return (this.actual === jasmine.POSITIVE_INFINITY);
};

/**
* Matcher that compares the actual to -Infinity.
*/
jasmine.Matchers.prototype.toBeNegativeInfinity = function() {
this.message = function() {
return [ "Expected " + jasmine.pp(this.actual) + " to be -Infinity." ];
};

return (this.actual === jasmine.NEGATIVE_INFINITY);
};

/**
* Matcher that boolean not-nots the actual.
*/
Expand Down