Skip to content


Subversion checkout URL

You can clone with
Download ZIP

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
Commits on Nov 07, 2010
@dchelimsky dchelimsky update relish task d7184c7
@dchelimsky dchelimsky update versions for development ed672c6
Commits on Nov 18, 2010
@dchelimsky dchelimsky tweak (c) beffc1e
Commits on Nov 19, 2010
@dchelimsky dchelimsky Added "rspec/mocks/standalone"
- useful in irb to explore the framework
- also eliminated two require calls per example when using rspec-mocks
  with rspec-core - huge performance boost (20% range)
Commits on Nov 21, 2010
@gioele gioele Method calls with expanded arrays require parentheses
This fixes the following warning:

    lib/rspec/mocks/message_expectation.rb:43: warning: `*' interpreted
    as argument prefix

- Closes #30.
@dchelimsky dchelimsky History 8d35da8
Commits on Nov 25, 2010
@dchelimsky dchelimsky explain README links to documentation 7b1a6a3
@dchelimsky dchelimsky upgrade to cucumber 0.9.4 6bde64b
Commits on Nov 26, 2010
@dchelimsky dchelimsky guard _this_ 880a2ae
@dchelimsky dchelimsky Fix bug where obj.should_receive(:foo).with(stub.as_null_object) would
pass with a false positive.

- Closes #233.
Commits on Nov 28, 2010
@dchelimsky dchelimsky more history 15b9327
@dchelimsky dchelimsky prep for 2.2 release 1024474
@dchelimsky dchelimsky bump version to 2.2 280af60
Commits on Nov 30, 2010
@dchelimsky dchelimsky links 58cc515
Commits on Dec 01, 2010
@dchelimsky dchelimsky bump to 2.3.0.pre a063713
Commits on Dec 07, 2010
@dchelimsky dchelimsky add example of explicit stub after as_null_object 80dbde5
Commits on Dec 11, 2010
@myronmarston myronmarston Fix our Marshal extension so that it does not interfere with objects …
…that have their own @mock_proxy instance variable.

Since our Marshal extension is loaded globally and affects every Marshal.dump call, we need to be extra careful not to unintentionally affect other things that rely on it.

- Closes #29.
@dchelimsky dchelimsky history e16666a
Commits on Dec 12, 2010
@dchelimsky dchelimsky align Gemfiles across rspec dev repos 301d1c9
@dchelimsky dchelimsky prep for 2.3.0 release dd336af
Commits on Dec 14, 2010
@dchelimsky dchelimsky bump version to 2.4.0.pre 89fc6cb
Commits on Dec 18, 2010
@dchelimsky dchelimsky dev-support: update relish task ec53f43
Commits on Dec 21, 2010
@dchelimsky dchelimsky reorganize the nav for relish 3c9bf80
Commits on Dec 30, 2010
@dchelimsky dchelimsky syntax cheat sheets for stubs and messae expectations c42ea70
Commits on Dec 31, 2010
@dchelimsky dchelimsky fix changelog link 0358d7f
Commits on Jan 02, 2011
@dchelimsky dchelimsky prep for 2.4.0 release 866f34a
Commits on Jan 16, 2011
@dnurzynski dnurzynski Fix bug: Message expectation counts don't work in combination with a …

- Closes #28.
- Closes #33.
@dchelimsky dchelimsky update history 4e7ea7d
Commits on Jan 17, 2011
@dchelimsky dchelimsky docs 38a6295
Commits on Feb 05, 2011
@txus txus Fix failure message when message received with incorrect args.
- Closes #34.
@dchelimsky dchelimsky changelog eaa4468
@Flameeyes Flameeyes Don't force cucumber presence on Rakefile.
Only define the cucumber tasks if cucumber is available, allowing for the
Rakefile to work without Cucumber installed.

Note that Cucumber is still part of the bundle, so unless you're
disabling bundler as well, this patch has no effect.

See #35 for background.

- Closes #35.
@dchelimsky dchelimsky doc tweaks f7e2297
@dchelimsky dchelimsky prep for 2.5 release a6c98bd
Commits on Feb 12, 2011
@dchelimsky dchelimsky regexps in Guardfile 5ac6d83
@dchelimsky 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
@myronmarston 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.
@myronmarston 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
@myronmarston 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.
@dchelimsky dchelimsky docs 6551f1a
@dchelimsky dchelimsky move some specs around 5f02fb6
Commits on Mar 06, 2011
@justinko justinko #as_null_object cucumber feature f89af24
Commits on Mar 08, 2011
@dchelimsky dchelimsky format doc ef127a5
Commits on Mar 23, 2011
@kaiwren kaiwren Not so dependent on a particular ruby implementation. Closes #44 Closes 8e2c1a2
Commits on Mar 25, 2011
@dchelimsky dchelimsky upgrade cucumber and aruba 20e9601
Commits on Mar 28, 2011
@dchelimsky dchelimsky update a couple of specs to more 21st century syntax 82c5d66
@dchelimsky 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
@myronmarston myronmarston Pull gems from github when they are not available locally on the file…
@myronmarston myronmarston Add travis config file. 52356e5
@kaiwren 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.
@dchelimsky dchelimsky Expect (failing) that any_instance.should_receive should fail if no
instance is created during the course of an example.
@kaiwren kaiwren Got exactly one instance done except for never and any_number_of_times 9483c14
@kaiwren kaiwren Completed handling never and any_number_of_times 81108f0
@kaiwren 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
@dchelimsky 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
@dchelimsky dchelimsky no need for begin/rescue in this example 646ff61
Commits on Apr 03, 2011
@myronmarston myronmarston Only build with the rubies travis has available. ca9c16b
Commits on Apr 10, 2011
@dchelimsky dchelimsky update Gemfile to address build issues with 1.9.1 3e31596
@dchelimsky dchelimsky more rubies for travis 877b268
@dchelimsky dchelimsky Dev: fully qualify class names for 1.9.1 9ae8c92
@dchelimsky dchelimsky add travis build status 1b59f2f
Commits on Apr 17, 2011
@kaiwren kaiwren Ensure that any_instance expectations are properly cleaned up between…
… examples.

- Closes #52.
@dchelimsky dchelimsky some refactoring of any_instance ef65d36
@dchelimsky dchelimsky Only reset any_instance recorder once. 189fda0
@dchelimsky dchelimsky fix scoping issue in spec for 1.9.1 b8d9800
@dchelimsky dchelimsky words in features 66737e5
@dchelimsky dchelimsky Mock#to_ary raises a NoMethodError
- supports Array#flatten with a Mock in the Array
- Closes #31.
@dchelimsky dchelimsky add feature to nav 2c1d323
@dchelimsky dchelimsky prep for 2.6.0.rc1 ce07e70
Commits on Apr 18, 2011
@dchelimsky dchelimsky comment aruba/cukes in Gemfile eb01c90
@dchelimsky dchelimsky update changelog 07feeb7
@dchelimsky dchelimsky bump to 2.6.0.rc2 468352c
@dchelimsky dchelimsky update the changelog 11354e2