Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chained onCall and withArgs doesn't work #23

Closed
jonathan-benn opened this issue Oct 18, 2017 · 4 comments
Closed

Chained onCall and withArgs doesn't work #23

jonathan-benn opened this issue Oct 18, 2017 · 4 comments

Comments

@jonathan-benn
Copy link

stub = sinon.stub()
stub.withArgs(42).onFirstCall().returns(1).onSecondCall().returns(2)
stub.returns(0);
assert stub(1) == 0
assert stub(42) == 1 # fails, returns 0
assert stub(1) == 0
assert stub(42) == 2
assert stub(1) == 0
assert stub(42) == 0
@jonathan-benn
Copy link
Author

This is issue is not the same as #22

@jonathan-benn
Copy link
Author

I am working on this now

@jonathan-benn
Copy link
Author

This one is difficult to solve, I am still working on it

@jonathan-benn
Copy link
Author

I finished the first part of a solution. I will clean it up and submit on Monday.

jonathan-benn pushed a commit to jonathan-benn/sinon that referenced this issue Nov 6, 2017
- e.g.
  stub.withArgs(42).onFirstCall().returns(1)
      .onSecondCall().returns(2)
- Makes progress toward fixing note35#23
jonathan-benn pushed a commit to jonathan-benn/sinon that referenced this issue Nov 6, 2017
- e.g.
stub.withArgs(42).onFirstCall().returns(1).onSecondCall().returns(2)
- Makes progress toward fixing note35#23
jonathan-benn pushed a commit to jonathan-benn/sinon that referenced this issue Nov 6, 2017
- e.g.
stub.withArgs(42).onFirstCall().returns(1).onSecondCall().returns(2)
- Makes progress toward fixing note35#23

Fixes note35#30
jonathan-benn pushed a commit to jonathan-benn/sinon that referenced this issue Nov 10, 2017
- e.g.
stub.withArgs(42).onFirstCall().returns(1).onSecondCall().returns(2)
- Makes progress toward fixing note35#23

Fixes note35#30
note35 pushed a commit that referenced this issue Nov 13, 2017
- e.g.
stub.withArgs(42).onFirstCall().returns(1).onSecondCall().returns(2)
- Makes progress toward fixing #23

Fixes #30
jonathan-benn pushed a commit to jonathan-benn/sinon that referenced this issue Nov 20, 2017
jonathan-benn pushed a commit to jonathan-benn/sinon that referenced this issue Nov 20, 2017
jonathan-benn pushed a commit to jonathan-benn/sinon that referenced this issue Nov 24, 2017
jonathan-benn pushed a commit to jonathan-benn/sinon that referenced this issue Dec 1, 2017
@note35 note35 closed this as completed in #37 Dec 2, 2017
note35 pushed a commit that referenced this issue Dec 2, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants