Skip to content
This repository
  • 63 commits
  • 66 files changed
  • 2 comments
  • 6 contributors
Nov 13, 2012
Andy Lindeman Fixes changes link c1af6e8
Nov 24, 2012
Myron Marston Fig line arg passed to class_eval so that it's correct.
There contents of the heredoc starts on the next line, hence the need for `+ 1`.
8b8d801
Myron Marston Fix broken link. 0d6eea7
Myron Marston Add support for #and_call_original to an #any_instance partial mock.
Fixes #197.
0f77e46
Myron Marston Add explanatory comments for my last commit. d2ef056
Nov 25, 2012
Myron Marston Handle additional any_instance / and_call_original edge cases.
For #197.
148db3c
Dec 02, 2012
Myron Marston Fix stub_const/hide_const to work properly with a const like "::Foo".
It didn't work properly with names containing leading '::' before.

Fixes #200.
17daf44
Dec 10, 2012
Myron Marston Merge pull request #204 from sanemat/fix/class-name
Use Kernel#inspect instead of #to_s
a209077
Dec 11, 2012
Murahashi Sanemat Kenichi Use Kernel#inspect instead of #to_s
Kernel#inspect does not call #to_s anymore, on Ruby2.0.0
394c14a
Dec 15, 2012
Myron Marston Run travis builds against ruby 2.0. 2dcfb20
Dec 19, 2012
Myron Marston Improve the way we run builds.
- No need for `find_path_to_rspec_exe`; I've discovered that `--standalone`
  and `--binstubs` together produce bins that don't load bundler.
- Add `-x` to `set -e` as that will cause the script to print each command
  as it runs.  No need for `print_and_run`.
- Add cucumber to test_all script, and use just that for the build.
63ae97f
Dec 20, 2012
Myron Marston Stash and restore aliased methods when the owner is reported wrong.
Fixes #206.

While I was at it, I wanted to verify that `and_call_original` works
with this case, so I added a spec for it, too.
f86d02c
Andy Lindeman Merge pull request #207 from rspec/handle_aliased_methods
Stash and restore aliased methods when the owner is reported wrong.
ac90673
Dec 21, 2012
Myron Marston Update Changelog. 5e41915
Myron Marston Release 2.12.1. d7aac2c
Myron Marston 1 more changelog entry I forgot.
[ci skip]
1ee14fc
Dec 25, 2012
Myron Marston Cleanup whitespace. 11cccc4
Myron Marston Simplify implementation of `and_raise`.
It can use an implementation block rather than needing to
maintain some extra state.
d9a7e36
Myron Marston Simplify implementation of `and_throw`.
It can use an implementation block rather than needing to
maintain some extra state.
16d30dc
Myron Marston Don't assume presence of rspec-core's `warn_deprecation` method.
rspec-mocks should be usable outside of rspec-core.
363406a
Myron Marston Deprecate `spec/mocks` file (for rspec-1 compatibility). f9c5d6a
Dec 30, 2012
Myron Marston Cleanup whitespace. eb6e30f
Myron Marston Add missing require. 0db78bc
Myron Marston Switch to new expect syntax. e5f11d7
Dec 31, 2012
Myron Marston Convert one more example I missed to `expect` syntax.
This one isn't run on 1.8.7 (the version I was using
last night when doing the conversion).
352870a
Jan 01, 2013
Andy Lindeman Merge pull request #208 from rspec/new_expect_syntax
Switch to new expect syntax.
dd06392
Jan 03, 2013
Andy Lindeman Adds failing spec demonstrating #210 8825ed3
Andy Lindeman Adds a candidate fix for #210 763dda3
Jan 04, 2013
Myron Marston Ignore .rspec-local. 6356c92
Jan 05, 2013
Myron Marston Fix `and_call_original` so that it looks for the method in all ancestors
...including those mixed into the singleton class (i.e.
via a module extended onto an object instance).

Fixes #212.
14ae958
Myron Marston Merge pull request #213 from rspec/issue-212
Fix `and_call_original` so that it looks for the method in all ancestors
80899f0
Jan 06, 2013
Andy Lindeman Cleans up the implementation after feedback from @myronmarston e3ab91c
Myron Marston Merge pull request #211 from rspec/issue_210
Adds failing spec demonstrating #210
a0c8217
Jan 27, 2013
Myron Marston Fix doc string typos.
[ci skip]
57543ba
Myron Marston Handle `stub_const("::SomeUndefinedConst")`.
I thought I fixed the problem in 17daf44,
but I missed this edge case.  That only fixed `stub_const("::SomeDefinedConst").

Fixes #200.
1e3f431
Myron Marston 2.12.2 release. bde69f0
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.
6123c97
Feb 03, 2013
Myron Marston Merge pull request #218 from rspec/remove_consecutive
Simplify implementation of consecutive return values.
d90f7f8
Myron Marston Refactor spec for greater clarity.
I found the use of `File.open` confusing for a spec
that demonstrates yielding multiple times. `File.open`
is a well-known API that only yields once.
c454058
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
one.

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.
977dc00
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.
6e89c7f
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
7f10451
Feb 14, 2013
Myron Marston Do not call `#nil?` extra times.
...in case `nil?` is expected a set number of times.

Fixes #224.
962c5a0
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 :(.
0594c4f
Feb 17, 2013
Myron Marston Fix missing_default_stub_error message so array args are handled prop…
…erly.

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

foo.bar("a")
foo.bar(2, 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.
8c58de8
Myron Marston Add changelog entry for #226.
[ci skip]
5f842f3
Myron Marston Refactoring: don't make `message_expectation` responsible for finding…
… a parent stub.

This was suggested by @dchelimsky:

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

Fixes #219.
aa3b226
Feb 18, 2013
David Chelimsky Only run example with BasicObject when BasicObject is defined.
It's not in Ruby < 1.9.
91b0259
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.
5d0e6de
Feb 21, 2013
Myron Marston Fix any_instance.should_not_receive when used w/ any_instance.should_…
…receive.

Fixes #228.
8dc2b1d
Feb 23, 2013
David Chelimsky add note about expecting same message multiple times with diff args t…
…o README
eea518f
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