Skip to content

Commit

Permalink
Split up 'was not called' and 'was called' into two separate assertions.
Browse files Browse the repository at this point in the history
  • Loading branch information
papandreou committed Sep 6, 2015
1 parent 7ac9ad8 commit ab004dc
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions lib/unexpected-sinon.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,9 +190,13 @@
}
});

expect.addAssertion('spy', 'was [not] called', function (expect, subject) {
this.errorMode = this.flags.not ? 'defaultOrNested' : 'default';
expect(getCalls(subject), '[!not] to satisfy', []);
expect.addAssertion('spy', 'was called', function (expect, subject) {
expect(getCalls(subject), 'not to satisfy', []);
});

expect.addAssertion('spy', 'was not called', function (expect, subject) {
this.errorMode = 'defaultOrNested';
expect(getCalls(subject), 'to satisfy', []);
});

expect.addAssertion('spyCall', 'to satisfy', function (expect, subject, value) {
Expand Down

0 comments on commit ab004dc

Please sign in to comment.