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

Always chain behavior with stub #1227

Merged

Conversation

zuzusik
Copy link
Contributor

@zuzusik zuzusik commented Jan 1, 2017

Purpose (TL;DR)

Fix issue #1100

How to verify

  1. Check out this branch (see github instructions below)
  2. npm install
  3. npm test

@coveralls
Copy link

coveralls commented Jan 1, 2017

Coverage Status

Coverage decreased (-0.02%) to 95.455% when pulling b723992 on zuzusik:zuzusik-always_chain_behavior_with_stub into 436c97f on sinonjs:master.

Copy link
Contributor

@fatso83 fatso83 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but I am going to keep it open for a little while for others to have a glance at this. I might be missing something, but it seems like you are just fixing an omission that should have been handled long ago. Thanks!

@fatso83 fatso83 merged commit e0973f0 into sinonjs:master Jan 7, 2017
@fatso83
Copy link
Contributor

fatso83 commented Jan 7, 2017

Hmm ... of course I missed a thing. It seems as this chaining does not apply to withArgs?

This stub will always return baz:
stub=sinon.stub().returns("moo").withArgs("foo").returns("bar").withArgs("boo").returns("baz")

This has been a bug since withArgs was introduced btw, so not something new.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants