Fix failure messages for positive/negative infinity matchers
- Fixes #1674
This commit is contained in:
@@ -4278,9 +4278,9 @@ getJasmineRequireObj().toBeNegativeInfinity = function(j$) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
if (result.pass) {
|
if (result.pass) {
|
||||||
result.message = 'Expected actual to be -Infinity.';
|
result.message = 'Expected actual not to be -Infinity.';
|
||||||
} else {
|
} else {
|
||||||
result.message = function() { return 'Expected ' + j$.pp(actual) + ' not to be -Infinity.'; };
|
result.message = function() { return 'Expected ' + j$.pp(actual) + ' to be -Infinity.'; };
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
@@ -4328,9 +4328,9 @@ getJasmineRequireObj().toBePositiveInfinity = function(j$) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
if (result.pass) {
|
if (result.pass) {
|
||||||
result.message = 'Expected actual to be Infinity.';
|
result.message = 'Expected actual not to be Infinity.';
|
||||||
} else {
|
} else {
|
||||||
result.message = function() { return 'Expected ' + j$.pp(actual) + ' not to be Infinity.'; };
|
result.message = function() { return 'Expected ' + j$.pp(actual) + ' to be Infinity.'; };
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ describe("toBeNegativeInfinity", function() {
|
|||||||
var matcher = jasmineUnderTest.matchers.toBeNegativeInfinity(),
|
var matcher = jasmineUnderTest.matchers.toBeNegativeInfinity(),
|
||||||
result = matcher.compare(0);
|
result = matcher.compare(0);
|
||||||
|
|
||||||
expect(result.message()).toEqual("Expected 0 not to be -Infinity.")
|
expect(result.message()).toEqual("Expected 0 to be -Infinity.")
|
||||||
});
|
});
|
||||||
|
|
||||||
it("succeeds for -Infinity", function() {
|
it("succeeds for -Infinity", function() {
|
||||||
@@ -25,7 +25,7 @@ describe("toBeNegativeInfinity", function() {
|
|||||||
result = matcher.compare(Number.NEGATIVE_INFINITY);
|
result = matcher.compare(Number.NEGATIVE_INFINITY);
|
||||||
|
|
||||||
expect(result.pass).toBe(true);
|
expect(result.pass).toBe(true);
|
||||||
expect(result.message).toEqual("Expected actual to be -Infinity.")
|
expect(result.message).toEqual("Expected actual not to be -Infinity.")
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ describe("toBePositiveInfinity", function() {
|
|||||||
var matcher = jasmineUnderTest.matchers.toBePositiveInfinity(),
|
var matcher = jasmineUnderTest.matchers.toBePositiveInfinity(),
|
||||||
result = matcher.compare(0);
|
result = matcher.compare(0);
|
||||||
|
|
||||||
expect(result.message()).toEqual("Expected 0 not to be Infinity.")
|
expect(result.message()).toEqual("Expected 0 to be Infinity.")
|
||||||
});
|
});
|
||||||
|
|
||||||
it("succeeds for Infinity", function() {
|
it("succeeds for Infinity", function() {
|
||||||
@@ -25,7 +25,7 @@ describe("toBePositiveInfinity", function() {
|
|||||||
result = matcher.compare(Number.POSITIVE_INFINITY);
|
result = matcher.compare(Number.POSITIVE_INFINITY);
|
||||||
|
|
||||||
expect(result.pass).toBe(true);
|
expect(result.pass).toBe(true);
|
||||||
expect(result.message).toEqual("Expected actual to be Infinity.")
|
expect(result.message).toEqual("Expected actual not to be Infinity.")
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -14,9 +14,9 @@ getJasmineRequireObj().toBeNegativeInfinity = function(j$) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
if (result.pass) {
|
if (result.pass) {
|
||||||
result.message = 'Expected actual to be -Infinity.';
|
result.message = 'Expected actual not to be -Infinity.';
|
||||||
} else {
|
} else {
|
||||||
result.message = function() { return 'Expected ' + j$.pp(actual) + ' not to be -Infinity.'; };
|
result.message = function() { return 'Expected ' + j$.pp(actual) + ' to be -Infinity.'; };
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
|
|||||||
@@ -14,9 +14,9 @@ getJasmineRequireObj().toBePositiveInfinity = function(j$) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
if (result.pass) {
|
if (result.pass) {
|
||||||
result.message = 'Expected actual to be Infinity.';
|
result.message = 'Expected actual not to be Infinity.';
|
||||||
} else {
|
} else {
|
||||||
result.message = function() { return 'Expected ' + j$.pp(actual) + ' not to be Infinity.'; };
|
result.message = function() { return 'Expected ' + j$.pp(actual) + ' to be Infinity.'; };
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
|
|||||||
Reference in New Issue
Block a user