Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

We’re showing branches in this repository, but you can also compare across forks.

base fork: rspec/rspec-mocks
head fork: rspec/rspec-mocks
Commits on Feb 12, 2011
David Chelimsky dchelimsky regexps in Guardfile 5ac6d83
David Chelimsky dchelimsky fix bug in which multiple chains with shared messages ending in hashes
failed to return the correct value

- also documented stub_chain(:a, :b => :c) format in feature
Commits on Feb 20, 2011
Myron Marston myronmarston Allow users to specify return values by passing a block to #at_least,…
… #at_most and #exactly.

- @mock.should_receive(:to_s).at_least(:once) { "return val" }
- @mock.should_receive(:to_s).at_most(:once) { "return val" }
- @mock.should_receive(:to_s).exactly(:once) { "return val" }

Each of the above now work but previously returned nothing since the block was discarded.

Closes #40.
Myron Marston myronmarston Fix yaml serialization when using Psych.
Without these changes, I was getting SystemStackErrors when calling YAML.dump(stubbed_object) or stubbed_object.to_yaml.

To test this, you may need to reinstall ruby 1.9.2 with psych support.  On OSX with homebrew and rvm, this will do the trick:

brew install libyaml
rvm install ruby-1.9.2 --with-libyaml-dir=/usr/local

Closes #36.
Commits on Feb 26, 2011
Myron Marston myronmarston Don't patch Psych.dump unless Psych is loaded and responds to #dump.
This fixes errors with running the specs on 1.9.2 w/o psych support compiled in.
David Chelimsky dchelimsky docs 6551f1a
David Chelimsky dchelimsky move some specs around 5f02fb6
Commits on Mar 06, 2011
Justin Ko justinko #as_null_object cucumber feature f89af24
Commits on Mar 08, 2011
David Chelimsky dchelimsky format doc ef127a5
Commits on Mar 23, 2011
Sidu Ponnappa kaiwren Not so dependent on a particular ruby implementation. Closes #44 Closes 8e2c1a2
Commits on Mar 25, 2011
David Chelimsky dchelimsky upgrade cucumber and aruba 20e9601
Commits on Mar 28, 2011
David Chelimsky dchelimsky update a couple of specs to more 21st century syntax 82c5d66
David Chelimsky dchelimsky Treat block passed to `with` as a dynamic matcher or a return value, but
not both.

This fixes issue #254 in rspec-core.

The `with` method accepts two forms:

  foo.should_receive(:bar).with(:arg) { ... }
  foo.should_receive(:bar).with { ... }

In the first form, we expect, and when it is received it
returns the value returned by eval'ing the block.

In the second form, the block itself is treated as an argument matcher.
The bug was that it was being eval'd twice because it was being treated
as both an argument matcher and a computed return value.
Commits on Mar 29, 2011
Myron Marston myronmarston Pull gems from github when they are not available locally on the file…
Myron Marston myronmarston Add travis config file. 52356e5
Sidu Ponnappa kaiwren Add support for any_instance:
- MyClass.any_instance.stub(:m)
- MyClass.any_instance.should_receive(:m)
- includes stub and mock APIs including
  - and_return, and_raise, and_yield
  - once, twice, exactly, any_number_of_times, never, at_least, at_most

- Closes #46.
- Closes #10.
alindeman alindeman Use #method_defined? instead of #instance_methods.include?.
- All specs now pass on MRI 1.8.7 and MRI 1.9.2.
David Chelimsky dchelimsky Expect (failing) that any_instance.should_receive should fail if no
instance is created during the course of an example.
Sidu Ponnappa kaiwren Got exactly one instance done except for never and any_number_of_times 9483c14
Sidu Ponnappa kaiwren Completed handling never and any_number_of_times 81108f0
Sidu Ponnappa kaiwren Fixed ordering of missed method names b48d777
Commits on Mar 30, 2011
alindeman alindeman Add feature for simple any_instance.stub use case 1f64f6d
alindeman alindeman Add feature for any_instance.should_receive use case d0d5e99
Commits on Mar 31, 2011
David Chelimsky dchelimsky Changlog and some minor tweaks
- removed unnecessary conditional
- reduced nesting in any_instance_spec
Commits on Apr 01, 2011
alindeman alindeman Add new features to .nav file (for Relish). Closes #50 5deee72
Commits on Apr 02, 2011
David Chelimsky dchelimsky no need for begin/rescue in this example 646ff61
Commits on Apr 03, 2011
Myron Marston myronmarston Only build with the rubies travis has available. ca9c16b
Commits on Apr 10, 2011
David Chelimsky dchelimsky update Gemfile to address build issues with 1.9.1 3e31596
David Chelimsky dchelimsky more rubies for travis 877b268
David Chelimsky dchelimsky Dev: fully qualify class names for 1.9.1 9ae8c92
David Chelimsky dchelimsky add travis build status 1b59f2f
Commits on Apr 17, 2011
Sidu Ponnappa kaiwren Ensure that any_instance expectations are properly cleaned up between…
… examples.

- Closes #52.
David Chelimsky dchelimsky some refactoring of any_instance ef65d36
David Chelimsky dchelimsky Only reset any_instance recorder once. 189fda0
David Chelimsky dchelimsky fix scoping issue in spec for 1.9.1 b8d9800
David Chelimsky dchelimsky words in features 66737e5
David Chelimsky dchelimsky Mock#to_ary raises a NoMethodError
- supports Array#flatten with a Mock in the Array
- Closes #31.
David Chelimsky dchelimsky add feature to nav 2c1d323
David Chelimsky dchelimsky prep for 2.6.0.rc1 ce07e70
Commits on Apr 18, 2011
David Chelimsky dchelimsky comment aruba/cukes in Gemfile eb01c90
David Chelimsky dchelimsky update changelog 07feeb7
David Chelimsky dchelimsky bump to 2.6.0.rc2 468352c
David Chelimsky dchelimsky update the changelog 11354e2
Commits on Apr 19, 2011
David Chelimsky dchelimsky reinstate cucumber and aruba ce11e75
Commits on Apr 20, 2011
David Chelimsky dchelimsky doc updates f11203d
David Chelimsky dchelimsky minor refactorings 79cf9aa
Commits on Apr 23, 2011
Sidu Ponnappa kaiwren Support multiple calls to any_instance in the same example.
- Closes #54.
Commits on Apr 30, 2011
David Chelimsky dchelimsky prep for 2.6.0.rc3 b023531
Commits on May 01, 2011
David Chelimsky dchelimsky bump to 2.6.0.rc4 0d05d6c
Commits on May 06, 2011
David Chelimsky dchelimsky prep for 2.6.0.rc5 4a02ebc
David Chelimsky dchelimsky prep for rc6 ba78f90
Commits on May 12, 2011
David Chelimsky dchelimsky prep for 2.6.0 3f1d77f