Skip to content
This repository
  • 27 commits
  • 20 files changed
  • 4 contributors
Jan 31, 2013
Myron Marston Simplify implementation of consecutive return values.
There's no need to track extra instance variable state (e.g. @consecutive); 
instead, the implementation lambda can just do the right thing.

This also fixes #217. Previously, message_expectation got confused when it
was in consecutive mode (due to being stubbed with multiple return values)
and then got mocked with a single return value. This simplified implementation
fixes this bug.
Feb 03, 2013
Myron Marston Merge pull request #218 from rspec/remove_consecutive
Simplify implementation of consecutive return values.
Myron Marston Refactor spec for greater clarity.
I found the use of `` confusing for a spec
that demonstrates yielding multiple times. ``
is a well-known API that only yields once.
Feb 04, 2013
Myron Marston Use the matching parent stub rather than just picking the first one.
Previously, when a mock expectation was added, it was derived as a
child stub from the first existing stub. However, if there were multiple
existing stubs constrained with different `with` criteria, this could
cause it to pick the wrong one because it arbitrarily chose the first

Our fix is to defer the choosing of the parent stub until the message
expectation is invoked, at which point we can properly match the
parent stub based on the arguments.

As part of this, I've refactored MessageExpectation, extracting a new
MessageImplementation class to hold the logic for an implementation
based on `and_return` and `and_yield` declarations.

Fixes #127.
Feb 07, 2013
Ryan Jones disallow unstub! on any_instance a283324
Feb 09, 2013
Myron Marston Merge pull request #221 from rspec/use_matching_parent_stub
Use the matching parent stub rather than just picking the first one.
Myron Marston MRI 2.0 is passing on travis, and we want to keep it that way. a6b052b
Feb 13, 2013
pjambet Use new Codeclimate badge, made by @olivierlacan ec9b5e5
Myron Marston Merge pull request #225 from pjambet/use_new_codeclimate_shield
Use new Codeclimate badge, made by @olivierlacan
Feb 14, 2013
Myron Marston Do not call `#nil?` extra times. case `nil?` is expected a set number of times.

Fixes #224.
Myron Marston Update changelog [ci skip]. ae02d47
Feb 16, 2013
Myron Marston rbx-18 is failing with strange errors on travis.
Missing or uninitialized constant: RbConfig (NameError)
I don't have the energy to fight with it now :(.
Feb 17, 2013
Myron Marston Fix missing_default_stub_error message so array args are handled prop…

The source of this bug is that `raise_similar_message_args_error` receives
a list of args from multiple calls, e.g.:"a"), 3)

translates to `[["a"], [2, 3]]` being passed to it.  For the other `raise_...` methods, they receive an args list from a single call
(e.g. just `["a"]` for the first call in the example above).

`raise_similar_message_args_error` has slightly different logic to handle
the fact that it is different, but when `raise_missing_default_stub_error`
was added in 409955f, it wrongly copied this logic.

Fixes #226.
Myron Marston Add changelog entry for #226.
[ci skip]
Myron Marston Refactoring: don't make `message_expectation` responsible for finding…
… a parent stub.

This was suggested by @dchelimsky:

#221 (comment)
Myron Marston Rename MessageImplementation to Implementation.
See #221 (comment) for the surrounding discussion.
Myron Marston Merge pull request #223 from RyanonRails/unstub_any_instance
disallow unstub! on any_instance
Myron Marston Add changelog entry for #223.
[ci skip]
Myron Marston Fix `any_instance` stubbing so that it works with `Delegator` subclas…

Fixes #219.
Feb 18, 2013
David Chelimsky Only run example with BasicObject when BasicObject is defined.
It's not in Ruby < 1.9.
Myron Marston Better fix for SimpleDelegator subclasses (#219).
My last fix did not properly simulate SimpleDelegator since it mixes in
a dup of Kernel and not Kernel itself.  This actually fixes it, and I
also fixed `and_call_original` (which suffered from the same bug) for
this case as well.
Feb 21, 2013
Myron Marston Fix any_instance.should_not_receive when used w/ any_instance.should_…

Fixes #228.
Feb 23, 2013
David Chelimsky add note about expecting same message multiple times with diff args t…
David Chelimsky fix type in README (that I introduced in previous commit) d0df33c
David Chelimsky more about should_receive multiple times with args in README 42faffa
Myron Marston Update changelog for release 88878d1
Myron Marston 2.13.0 release e652a02
Something went wrong with that request. Please try again.