diff --git a/lib/jasmine-core/jasmine.js b/lib/jasmine-core/jasmine.js index 4d5e330e..57c6945f 100644 --- a/lib/jasmine-core/jasmine.js +++ b/lib/jasmine-core/jasmine.js @@ -6774,7 +6774,7 @@ getJasmineRequireObj().toHaveNoOtherSpyInteractions = function(j$) { if (result.pass) { result.message = - "Expected to have other spy interactions but it didn't."; + "Expected a spy object to have other spy interactions but it didn't."; } else { const ppUnexpectedCalls = unexpectedCalls .map( @@ -6783,9 +6783,9 @@ getJasmineRequireObj().toHaveNoOtherSpyInteractions = function(j$) { .join(',\n'); result.message = - 'Expected to have no other spy interactions, but it had the following calls:\n' + + 'Expected a spy object to have no other spy interactions, but it had the following calls:\n' + ppUnexpectedCalls + - '.\n\n'; + '.'; } return result; diff --git a/spec/core/matchers/toHaveNoOtherSpyInteractionsSpec.js b/spec/core/matchers/toHaveNoOtherSpyInteractionsSpec.js index 195453b6..8f41b34b 100644 --- a/spec/core/matchers/toHaveNoOtherSpyInteractionsSpec.js +++ b/spec/core/matchers/toHaveNoOtherSpyInteractionsSpec.js @@ -40,10 +40,9 @@ describe('toHaveNoOtherSpyInteractions', function() { let result = matcher.compare(spyObj); expect(result.pass).toBeFalse(); - // TODO: trim trailing newlines expect(result.message).toEqual( - 'Expected to have no other spy interactions, but it had the following calls:\n' + - " NewClass.spyA called with [ 'x' ].\n\n" + 'Expected a spy object to have no other spy interactions, but it had the following calls:\n' + + " NewClass.spyA called with [ 'x' ]." ); }); @@ -64,9 +63,9 @@ describe('toHaveNoOtherSpyInteractions', function() { let result = matcher.compare(spyObj); expect(result.pass).toBeFalse(); expect(result.message).toEqual( - 'Expected to have no other spy interactions, but it had the following calls:\n' + - ' NewClass.spyA called with [ ],\n' + - ' NewClass.spyB called with [ ].\n\n' + 'Expected a spy object to have no other spy interactions, but it had the following calls:\n' + + ' NewClass.spyA called with [ ],\n' + + ' NewClass.spyB called with [ ].' ); }); @@ -82,7 +81,7 @@ describe('toHaveNoOtherSpyInteractions', function() { let result = matcher.compare(spyObj); expect(result.pass).toBeTrue(); expect(result.message).toEqual( - "Expected to have other spy interactions but it didn't." + "Expected a spy object to have other spy interactions but it didn't." ); }); @@ -106,7 +105,7 @@ describe('toHaveNoOtherSpyInteractions', function() { let matcher = jasmineUnderTest.matchers.toHaveNoOtherSpyInteractions(); let spyObj = jasmineUnderTest .getEnv() - .createSpyObj('NewClass', ['spyA', 'spyB']); + .createSpyObj('mySpyObj', ['spyA', 'spyB']); expect(function() { matcher.compare(spyObj, 'an argument'); @@ -117,7 +116,7 @@ describe('toHaveNoOtherSpyInteractions', function() { let matcher = jasmineUnderTest.matchers.toHaveNoOtherSpyInteractions(); const spyObj = jasmineUnderTest .getEnv() - .createSpyObj('NewClass', ['notSpy']); + .createSpyObj('mySpyObj', ['notSpy']); // Removing spy since spy objects cannot be created without spies. spyObj.notSpy = function() {}; diff --git a/src/core/matchers/toHaveNoOtherSpyInteractions.js b/src/core/matchers/toHaveNoOtherSpyInteractions.js index 9c7d2710..13d9827e 100644 --- a/src/core/matchers/toHaveNoOtherSpyInteractions.js +++ b/src/core/matchers/toHaveNoOtherSpyInteractions.js @@ -64,7 +64,7 @@ getJasmineRequireObj().toHaveNoOtherSpyInteractions = function(j$) { if (result.pass) { result.message = - "Expected to have other spy interactions but it didn't."; + "Expected a spy object to have other spy interactions but it didn't."; } else { const ppUnexpectedCalls = unexpectedCalls .map( @@ -73,9 +73,9 @@ getJasmineRequireObj().toHaveNoOtherSpyInteractions = function(j$) { .join(',\n'); result.message = - 'Expected to have no other spy interactions, but it had the following calls:\n' + + 'Expected a spy object to have no other spy interactions, but it had the following calls:\n' + ppUnexpectedCalls + - '.\n\n'; + '.'; } return result;