Skip to content

Commit

Permalink
Merge 217a032 into f701abe
Browse files Browse the repository at this point in the history
  • Loading branch information
hrimhari committed Mar 27, 2017
2 parents f701abe + 217a032 commit bb44c07
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/sinon/mock-expectation.js
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ var mockExpectation = {
mockExpectation.fail(this.method + " received wrong arguments " + format(args) +
", expected " + format(expectedArguments));
}
});
}, this);
},

allowsCall: function allowsCall(thisValue, args) {
Expand Down
13 changes: 12 additions & 1 deletion test/mock-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -475,6 +475,17 @@ describe("sinonMock", function () {
});

describe(".withArgs", function () {
var expectedException = function (name) {
return {
test: function (actual) {
return actual.name === name;
},
toString: function () {
return name;
}
};
};

it("returns expectation for chaining", function () {
assert.same(this.expectation.withArgs(1), this.expectation);
});
Expand Down Expand Up @@ -510,7 +521,7 @@ describe("sinonMock", function () {

assert.exception(function () {
expectation(2, 2, 3);
}, "ExpectationError");
}, expectedException("ExpectationError"));
});

it("allows excessive args", function () {
Expand Down

0 comments on commit bb44c07

Please sign in to comment.