Skip to content

Commit

Permalink
chore(matchers): fix hasBeenCalledOnceWith matcher
Browse files Browse the repository at this point in the history
the error message was wrong and misleading
  • Loading branch information
IgorMinar committed Feb 12, 2013
1 parent 035e013 commit c0a0781
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions test/matchers.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,24 +109,24 @@ beforeEach(function() {
if (this.actual.callCount != 1) {
if (this.actual.callCount == 0) {
return [
'Expected spy ' + this.actual.identity + ' to have been called with ' +
'Expected spy ' + this.actual.identity + ' to have been called once with ' +
jasmine.pp(expectedArgs) + ' but it was never called.',
'Expected spy ' + this.actual.identity + ' not to have been called with ' +
jasmine.pp(expectedArgs) + ' but it was.'
];
}

return [
'Expected spy ' + this.actual.identity + ' to have been called with ' +
jasmine.pp(expectedArgs) + ' but it was never called.',
'Expected spy ' + this.actual.identity + ' not to have been called with ' +
'Expected spy ' + this.actual.identity + ' to have been called once with ' +
jasmine.pp(expectedArgs) + ' but it was called ' + this.actual.callCount + ' times.',
'Expected spy ' + this.actual.identity + ' not to have been called once with ' +
jasmine.pp(expectedArgs) + ' but it was.'
];
} else {
return [
'Expected spy ' + this.actual.identity + ' to have been called with ' +
'Expected spy ' + this.actual.identity + ' to have been called once with ' +
jasmine.pp(expectedArgs) + ' but was called with ' + jasmine.pp(this.actual.argsForCall),
'Expected spy ' + this.actual.identity + ' not to have been called with ' +
'Expected spy ' + this.actual.identity + ' not to have been called once with ' +
jasmine.pp(expectedArgs) + ' but was called with ' + jasmine.pp(this.actual.argsForCall)
];
}
Expand Down

0 comments on commit c0a0781

Please sign in to comment.