Skip to content
This repository
  • 98 commits
  • 64 files changed
  • 16 contributors
Mar 05, 2012
Nathan Long Explained why `before(:all)` won't work for stubs. 0815a4a
Mar 17, 2012
David Chelimsky dev: add a script to download ruby-debug-base19-0.11.26.gem and linec…
…ache19-0.5.13.gem to a local cache

[ci skip]
David Chelimsky only one ref to yard please c8a5ef5
Mar 20, 2012
Myron Marston Extract mock logic into TestDouble module.
This allows objects to be treated as a pure test double without needing to subclass RSpec::Mocks::Mock.

Closes #117.
Mar 27, 2012
Maeve Revels and_raise should support intentionally raising an ArgumentError 38ddf48
Myron Marston Merge pull request #121 from maeve/fix-raising-argumenterrors
and_raise should support intentionally raising an ArgumentError
Apr 15, 2012
David Chelimsky fail fast when an exactly or at_most expectation is exceeded fb9c76c
David Chelimsky minor refactoring for clarity 381c7c8
David Chelimsky a little more refactoring 764680c
David Chelimsky Refactoring: collapse concepts of method_block and return_block into
Apr 17, 2012
David Chelimsky Make the fact that you can set message expectations on class objects
more obvious.

- Closes #125.

[ci skip]
Cory Foy Correct spelling of "Responses" 40a2a0f
Apr 18, 2012
Justin Ko Merge pull request #126 from CoryFoy/patch-1
Correct spelling of "Responses"
Apr 21, 2012
David Chelimsky one line on one line fa13314
Apr 22, 2012
David Chelimsky shorten file extension 707f515
David Chelimsky align config files across rspec projects 4b47e54
David Chelimsky dev: align Gemfiles across rspec projects b4204fb
Apr 30, 2012
David Chelimsky update yard to 0.8 1e4c1e6
May 03, 2012
David Chelimsky refactor subject out of one spec 604dc5d
David Chelimsky update changelog for 2.10 release 4862911
David Chelimsky bump to 2.10.0 6732d62
May 04, 2012
David Chelimsky rename some things in a spec d4b983c
David Chelimsky Fixed bug where at_least(0) failed when message was received
- Fixes #132
David Chelimsky Make sure at_least(0) passes even when never called
- Fixes #132 again
May 05, 2012
David Chelimsky dev: config for :focus 877dfa6
David Chelimsky dev: refactor a spec 2e9d990
David Chelimsky should_not_receive ignores and_return
- See #132
David Chelimsky bump to 2.10.1 112b430
May 08, 2012
David Chelimsky Expose ArgumentListMatcher as a formal API
- supports use by 3rd party mock frameworks like Surrogate.
May 13, 2012
David Chelimsky spec refactoring: move shared examples to the one spec using them. eb12635
David Chelimsky dev: use :unless filter instead of a global exclusion filter e03d66b
David Chelimsky dev: rename context 671076d
David Chelimsky spec refactoring: rename subject with intention revealing name
- even though 'object' is no less generic than 'subject', it makes it
  more clear that we're talking about a generic object.
May 17, 2012
David Chelimsky Merge pull request #115 from nathanl/master
Explained why `before(:all)` won't work for stubs.
Myron Marston Fix a regression.
When doing something like:

  double.stub(:foo).and_return(a, b)
  double.should_receive(:foo).once { a } used to work, but in 2.10 it raises a NoMethodError (#size).
May 19, 2012
Sidu Ponnappa Replicating Issue #120 7d85604
May 21, 2012
Sidu Ponnappa Issue #120: Under any_instance, modify #dup to remove the mock proxy 5de6500
Myron Marston Update changelog. a11fcdc
May 22, 2012
Justin Ko Merge pull request #138 from c42engineering/issue_120
Issue #120
Justin Ko changelog [ci skip] c64c605
Justin Ko No need for an "issue specific" spec file. aca2b40
May 23, 2012
Sidu Ponnappa Replicated Issue #124 419b64a
aakash dharmadhikari issue #124: adding support for any_instance.should_not_receive 6e858e4
David Chelimsky Merge pull request #139 from c42engineering/issue124
add support for any_instance.should_not_receive
May 24, 2012
David Chelimsky `should_receive(x).at_least(:once).and_return(y)` always returns y ev…
…en if x is already stubbed

    widget.stub(:count => 1)
    widget.count #=> 2
    widget.count #=> 2

If there is no return value set, it will fall back to the stub value:

    widget.stub(:count => 1)
    widget.count #=> 1
    widget.count #=> 1

- Fixes #142
May 25, 2012
Bryan Helmkamp Add Code Climate badge 8879661
David Chelimsky Merge pull request #143 from brynary/codeclimate-badge
Add Code Climate badge
May 31, 2012
Patrick Ellis `:%s/ducktype/duck_type/g` 5edfe94
David Chelimsky Merge pull request #145 from pjellis/patch-1
[typo] underscore-ize 'ducktype' in
Jun 02, 2012
Myron Marston First pass at implementing constant stubbing.
This is almost copied verbatim from rspec-fire.

For #144.
Myron Marston Always restore original constants.
The original logic from rspec-fire did not restore original constants
if the user changed them in the example after stubbing them, but after
talking it over with @dchelimsky and @garyberhnardt we've decided to
be consistent and always restore them.

For #144.
Myron Marston Remove the bang from our #stub! methods.
I'm not really sure why I used them when I wrote this in rspec-fire;
given there were not corresponding bang-less methods, it didn't
really make sense.

For #144.
Myron Marston Fix a constant stubbing edge case.
stub_const("A::B::C", whatever) cannot work if A::B is defined
but A::B is not a module.

For #144.
Myron Marston Remove unused method.
For #144.
Myron Marston Add API docs for new constant stubbing code.
For #144.
Myron Marston Add cukes for new stub_const feature.
Closes #144.
Myron Marston Fix typo pointed out by @justinko. 7ab3d61
Jun 03, 2012
Myron Marston Replace duplicated README content with a link.
As per the conversation with @justinko and @dchelimsky:
#146 (comment)

Note that this link is broken for now because this hasn't
yet been merged into master. But I figured it was better
not to use a working link just to the branch since that
branch will likely be deleted in the near future.
Myron Marston Refactor constant stubbers a bit.
This is based on @justinko's suggestions:
#146 (comment)
Myron Marston Remove unused helper method. 22c2049
Jun 04, 2012
Issue #123: Improved error message when user forgets to stub a method…
… with default behavior.
David Chelimsky Merge pull request #147 from c42engineering/issue123
Issue #123: Improved error message when user forgets to stub a method with a default.
David Chelimsky Use the improved message from the prev commit for stubs, not message …

- Closes #147, #123.
Jun 06, 2012
Myron Marston Return stubbed value rather than original value from stub_const.
This allows chaining:

  stub_const("Foo", double).stub(:foo)
Myron Marston Add `Constant.original` API to query rspec-mocks about stubbed consta…

This needs to be documented, but I want to get feedback from others before spending effort on that.
Jun 07, 2012
Myron Marston Make Constant.unstubbed private since it's an internal API. fd595a8
Myron Marston Refactor away the use of #its.
#its is going away in rspec-core at some future point, so we shouldn't use it here.
Jun 10, 2012
Myron Marston Add API docs for Constant.original query API. 3b63c51
Myron Marston Merge pull request #146 from rspec/constant-stubbing f5c63c3
Myron Marston Mention new stub_const feature in changelog. f04d527
Jun 15, 2012
David Chelimsky refactor: rename ExpectationChain to PositiveExpectationChain
Also extract base ExpectationChain.
Jun 17, 2012
Myron Marston Prevent infinite loop when interpolating a null double as an integer …
…into a string.

Closes #154.
Myron Marston Weird, 1.9.2 acts differently here than 1.9.3 and 1.8.7. b96dd92
Jun 23, 2012
Myron Marston Fix `should_receive` to preserve null object behavior.
Given a case like:

   double = mock.as_null_object

...`` was returning nil when it should return the double itself, since that's the expected null object behavior and no implementation was provided for the mock expectation.

Closes #155.
Jun 24, 2012
Myron Marston Cleanup whitespace.
(Actually, I'm mostly doing this just to trigger a travis build. A
recent change in rspec-expectations[1] broke the rspec-mocks
travis build, and now that it's fixed[2], I want to see that the
rspec-mocks build is passing.  I figured I may as well make a useful
but non functional change while I'm at it, though).

[1] rspec/rspec-expectations@4024344#commitcomment-1496381
[2] rspec/rspec-expectations@a3e2839
Jun 26, 2012
Myron Marston Merge pull request #156 from amarshall/master
Raise RuntimeError instead of Exception by default in and_raise to match Ruby's default
Myron Marston Update changelog. aa179ed
Jun 27, 2012
Andrew Marshall Raise RuntimeError instead by default in and_raise to match Ruby default dc5e1a7
Jul 07, 2012
David Chelimsky bump to 2.11.0 e6bba62
David Chelimsky improve automation for publishing to b35b5b4
Jul 09, 2012
Myron Marston Fix edge case bug exposed w/ `should_receive` on a null object w/ a p…
…revious stub.

In a case like:

  double = stub.as_null_object
  double.stub(:foo => "bar")
  double.should_receive(:foo) used to return "bar", but due to my changes in a5f296e it was returning `self`.
Myron Marston 2.11.1 release. 24090f8
Jul 10, 2012
Uģis Ozols Add missing 'be's to the README. 5288070
Justin Ko Merge pull request #161 from ugisozols/master
Add missing 'be's to the README.
Myron Marston Fix ruby warnings.
- lib/rspec/mocks/error_generator.rb:32: warning: assigned but unused variable - expected_args
- lib/rspec/mocks/error_generator.rb:33: warning: assigned but unused variable - actual_args
- lib/rspec/mocks/stub_const.rb:8: warning: shadowing outer local variable - name
- lib/rspec/mocks/stub_const.rb:12: warning: shadowing outer local variable - name
- spec/rspec/mocks/stub_const_spec.rb:60: warning: assigned but unused variable - orig_value
- lib/rspec/mocks/stub_const.rb:233: warning: instance variable @registered_with_mocks_space not initialized

Closes #162.
Aug 01, 2012
David Chelimsky Don't modify dup on classes that don't support dup
Fixes #168.
Aug 02, 2012
daneget Fix any_instance to handle methods defined on superclasses.
Previously, the recorder implementation created a SystemStackError.

Closes #152.
Myron Marston Cleanup spec a bit. 306ee36
Myron Marston Update changelog. f1a2682
Aug 05, 2012
David Chelimsky align the feature READMEs for stubs and message expectations e2826c6
David Chelimsky dev: update optional dev dependencies 37e095c
Aug 10, 2012
Jim Deville fix formatting for relish df607ea
Andy Lindeman Merge pull request #173 from jredville/master
Clean up formatting for Relish
Myron Marston Fix use of const_defined? and const_get so it ignores top-level const…

I didn't realize this previously, but these methods can pick up a top-level
constant when you don't intend it (e.g. ::Hash when checking MyGem.const_defined?("Hash")).
Aug 11, 2012
Myron Marston 2.11.2 release. e7bd234
Sep 16, 2012
Myron Marston Merge bug-fix commits from master into 2-11-maintenance.
This is in prep for the 2.11.3 release.

For future reference, I used the following steps to do this, starting
from a checkout of master:

* `git checkout -b bug_fixes_from_master`
* `git rebase -i v2.11.0`
* Removed the non-bug fix commits from the list of commits
  during interactive rebase.
* `git checkout 2-11-maintenance`
* `git merge bug_fixes_from_master`

Sep 18, 2012
Myron Marston Fix confusing error message.
When a class method was mocked and it was called an extra time with the wrong arguments, the error being raised was:

"NoMethodError: undefined method `bar' for Object:Class"

...which was very confusing.
Sep 19, 2012
Myron Marston 2.11.3 release. d0bcce4