Fix failure messages for positive/negative infinity matchers

- Fixes #1674
This commit is contained in:
Gregg Van Hove
2019-04-16 17:39:20 -07:00
parent fd60b5737c
commit 2fbeb201bc
5 changed files with 12 additions and 12 deletions

View File

@@ -4278,9 +4278,9 @@ getJasmineRequireObj().toBeNegativeInfinity = function(j$) {
};
if (result.pass) {
result.message = 'Expected actual to be -Infinity.';
result.message = 'Expected actual not to be -Infinity.';
} 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;
@@ -4328,9 +4328,9 @@ getJasmineRequireObj().toBePositiveInfinity = function(j$) {
};
if (result.pass) {
result.message = 'Expected actual to be Infinity.';
result.message = 'Expected actual not to be Infinity.';
} 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;

View File

@@ -17,7 +17,7 @@ describe("toBeNegativeInfinity", function() {
var matcher = jasmineUnderTest.matchers.toBeNegativeInfinity(),
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() {
@@ -25,7 +25,7 @@ describe("toBeNegativeInfinity", function() {
result = matcher.compare(Number.NEGATIVE_INFINITY);
expect(result.pass).toBe(true);
expect(result.message).toEqual("Expected actual to be -Infinity.")
expect(result.message).toEqual("Expected actual not to be -Infinity.")
});
});

View File

@@ -17,7 +17,7 @@ describe("toBePositiveInfinity", function() {
var matcher = jasmineUnderTest.matchers.toBePositiveInfinity(),
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() {
@@ -25,7 +25,7 @@ describe("toBePositiveInfinity", function() {
result = matcher.compare(Number.POSITIVE_INFINITY);
expect(result.pass).toBe(true);
expect(result.message).toEqual("Expected actual to be Infinity.")
expect(result.message).toEqual("Expected actual not to be Infinity.")
});
});

View File

@@ -14,9 +14,9 @@ getJasmineRequireObj().toBeNegativeInfinity = function(j$) {
};
if (result.pass) {
result.message = 'Expected actual to be -Infinity.';
result.message = 'Expected actual not to be -Infinity.';
} 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;

View File

@@ -14,9 +14,9 @@ getJasmineRequireObj().toBePositiveInfinity = function(j$) {
};
if (result.pass) {
result.message = 'Expected actual to be Infinity.';
result.message = 'Expected actual not to be Infinity.';
} 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;