@@ -1,9 +1,9 @@
|
||||
describe('toHaveBeenCalledOnceWith', function() {
|
||||
it('passes when the actual was called only once and with matching parameters', function() {
|
||||
const pp = jasmineUnderTest.makePrettyPrinter(),
|
||||
util = new jasmineUnderTest.MatchersUtil({ pp: pp }),
|
||||
matcher = jasmineUnderTest.matchers.toHaveBeenCalledOnceWith(util),
|
||||
calledSpy = new jasmineUnderTest.Spy('called-spy');
|
||||
const pp = privateUnderTest.makePrettyPrinter(),
|
||||
util = new privateUnderTest.MatchersUtil({ pp: pp }),
|
||||
matcher = privateUnderTest.matchers.toHaveBeenCalledOnceWith(util),
|
||||
calledSpy = new privateUnderTest.Spy('called-spy');
|
||||
|
||||
calledSpy('a', 'b');
|
||||
const result = matcher.compare(calledSpy, 'a', 'b');
|
||||
@@ -20,13 +20,13 @@ describe('toHaveBeenCalledOnceWith', function() {
|
||||
return true;
|
||||
}
|
||||
],
|
||||
matchersUtil = new jasmineUnderTest.MatchersUtil({
|
||||
matchersUtil = new privateUnderTest.MatchersUtil({
|
||||
customTesters: customEqualityTesters
|
||||
}),
|
||||
matcher = jasmineUnderTest.matchers.toHaveBeenCalledOnceWith(
|
||||
matcher = privateUnderTest.matchers.toHaveBeenCalledOnceWith(
|
||||
matchersUtil
|
||||
),
|
||||
calledSpy = new jasmineUnderTest.Spy('called-spy');
|
||||
calledSpy = new privateUnderTest.Spy('called-spy');
|
||||
|
||||
calledSpy('a', 'b');
|
||||
const result = matcher.compare(calledSpy, 'a', 'a');
|
||||
@@ -35,10 +35,10 @@ describe('toHaveBeenCalledOnceWith', function() {
|
||||
});
|
||||
|
||||
it('fails when the actual was never called', function() {
|
||||
const pp = jasmineUnderTest.makePrettyPrinter(),
|
||||
util = new jasmineUnderTest.MatchersUtil({ pp: pp }),
|
||||
matcher = jasmineUnderTest.matchers.toHaveBeenCalledOnceWith(util),
|
||||
calledSpy = new jasmineUnderTest.Spy('called-spy');
|
||||
const pp = privateUnderTest.makePrettyPrinter(),
|
||||
util = new privateUnderTest.MatchersUtil({ pp: pp }),
|
||||
matcher = privateUnderTest.matchers.toHaveBeenCalledOnceWith(util),
|
||||
calledSpy = new privateUnderTest.Spy('called-spy');
|
||||
|
||||
const result = matcher.compare(calledSpy, 'a', 'b');
|
||||
|
||||
@@ -49,10 +49,10 @@ describe('toHaveBeenCalledOnceWith', function() {
|
||||
});
|
||||
|
||||
it('fails when the actual was called once with different parameters', function() {
|
||||
const pp = jasmineUnderTest.makePrettyPrinter(),
|
||||
util = new jasmineUnderTest.MatchersUtil({ pp: pp }),
|
||||
matcher = jasmineUnderTest.matchers.toHaveBeenCalledOnceWith(util),
|
||||
calledSpy = new jasmineUnderTest.Spy('called-spy');
|
||||
const pp = privateUnderTest.makePrettyPrinter(),
|
||||
util = new privateUnderTest.MatchersUtil({ pp: pp }),
|
||||
matcher = privateUnderTest.matchers.toHaveBeenCalledOnceWith(util),
|
||||
calledSpy = new privateUnderTest.Spy('called-spy');
|
||||
|
||||
calledSpy('a', 'c');
|
||||
const result = matcher.compare(calledSpy, 'a', 'b');
|
||||
@@ -64,10 +64,10 @@ describe('toHaveBeenCalledOnceWith', function() {
|
||||
});
|
||||
|
||||
it('fails when the actual was called multiple times with expected parameters', function() {
|
||||
const pp = jasmineUnderTest.makePrettyPrinter(),
|
||||
util = new jasmineUnderTest.MatchersUtil({ pp: pp }),
|
||||
matcher = jasmineUnderTest.matchers.toHaveBeenCalledOnceWith(util),
|
||||
calledSpy = new jasmineUnderTest.Spy('called-spy');
|
||||
const pp = privateUnderTest.makePrettyPrinter(),
|
||||
util = new privateUnderTest.MatchersUtil({ pp: pp }),
|
||||
matcher = privateUnderTest.matchers.toHaveBeenCalledOnceWith(util),
|
||||
calledSpy = new privateUnderTest.Spy('called-spy');
|
||||
|
||||
calledSpy('a', 'b');
|
||||
calledSpy('a', 'b');
|
||||
@@ -80,10 +80,10 @@ describe('toHaveBeenCalledOnceWith', function() {
|
||||
});
|
||||
|
||||
it('fails when the actual was called multiple times (one of them - with expected parameters)', function() {
|
||||
const pp = jasmineUnderTest.makePrettyPrinter(),
|
||||
util = new jasmineUnderTest.MatchersUtil({ pp: pp }),
|
||||
matcher = jasmineUnderTest.matchers.toHaveBeenCalledOnceWith(util),
|
||||
calledSpy = new jasmineUnderTest.Spy('called-spy');
|
||||
const pp = privateUnderTest.makePrettyPrinter(),
|
||||
util = new privateUnderTest.MatchersUtil({ pp: pp }),
|
||||
matcher = privateUnderTest.matchers.toHaveBeenCalledOnceWith(util),
|
||||
calledSpy = new privateUnderTest.Spy('called-spy');
|
||||
|
||||
calledSpy('a', 'b');
|
||||
calledSpy('a', 'c');
|
||||
@@ -96,9 +96,9 @@ describe('toHaveBeenCalledOnceWith', function() {
|
||||
});
|
||||
|
||||
it('throws an exception when the actual is not a spy', function() {
|
||||
const pp = jasmineUnderTest.makePrettyPrinter(),
|
||||
util = new jasmineUnderTest.MatchersUtil({ pp: pp }),
|
||||
matcher = jasmineUnderTest.matchers.toHaveBeenCalledOnceWith(util),
|
||||
const pp = privateUnderTest.makePrettyPrinter(),
|
||||
util = new privateUnderTest.MatchersUtil({ pp: pp }),
|
||||
matcher = privateUnderTest.matchers.toHaveBeenCalledOnceWith(util),
|
||||
fn = function() {};
|
||||
|
||||
expect(function() {
|
||||
@@ -107,10 +107,10 @@ describe('toHaveBeenCalledOnceWith', function() {
|
||||
});
|
||||
|
||||
it('set the correct calls as verified when passing', function() {
|
||||
const pp = jasmineUnderTest.makePrettyPrinter(),
|
||||
util = new jasmineUnderTest.MatchersUtil({ pp: pp }),
|
||||
matcher = jasmineUnderTest.matchers.toHaveBeenCalledOnceWith(util),
|
||||
calledSpy = new jasmineUnderTest.Spy('called-spy');
|
||||
const pp = privateUnderTest.makePrettyPrinter(),
|
||||
util = new privateUnderTest.MatchersUtil({ pp: pp }),
|
||||
matcher = privateUnderTest.matchers.toHaveBeenCalledOnceWith(util),
|
||||
calledSpy = new privateUnderTest.Spy('called-spy');
|
||||
|
||||
calledSpy('x');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user