Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Failing test case for Issue 176 #177

Closed
wants to merge 1 commit into from

2 participants

@anthonygreen

A failing unit test for Issue 176 "Chaining sinon.stub() with multiple .withArgs only stubs the last declaration"

@cjohansen
Owner

Thanks!

@cjohansen cjohansen closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Sep 25, 2012
  1. @anthonygreen
This page is out of date. Refresh to see the latest.
Showing with 8 additions and 0 deletions.
  1. +8 −0 test/sinon/stub_test.js
View
8 test/sinon/stub_test.js
@@ -1032,6 +1032,14 @@ buster.testCase("sinon.stub", {
assert.equals(stub(), 23);
assert.equals(stub(42), 99);
},
+
+ "chains filters that return values based on arguments": function () {
+ var stub = sinon.stub().withArgs(42).returns(99).withArgs(24).returns(66);
+
+ assert.equals(stub(42), 99);
+ assert.equals(stub(24), 66);
+
+ },
"filters exceptions based on arguments": function () {
var stub = sinon.stub().returns(23);
Something went wrong with that request. Please try again.