Skip to content

Comparing changes

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

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also .
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
Commits on Apr 19, 2011
@dchelimsky dchelimsky reinstate cucumber and aruba ce11e75
Commits on Apr 20, 2011
@dchelimsky dchelimsky doc updates f11203d
@dchelimsky dchelimsky minor refactorings 79cf9aa
Commits on Apr 23, 2011
@kaiwren kaiwren Support multiple calls to any_instance in the same example.
- Closes #54.
Commits on Apr 27, 2011
@aakashd aakashd adding idea files to ignore list d228f34
Commits on Apr 30, 2011
@dchelimsky dchelimsky prep for 2.6.0.rc3 b023531
Commits on May 01, 2011
@dchelimsky dchelimsky bump to 2.6.0.rc4 0d05d6c
@kaiwren kaiwren Merge branch 'master' of e70e741
Commits on May 06, 2011
@dchelimsky dchelimsky prep for 2.6.0.rc5 4a02ebc
@dchelimsky dchelimsky prep for rc6 ba78f90
Commits on May 12, 2011
@dchelimsky dchelimsky prep for 2.6.0 3f1d77f
Commits on May 21, 2011
@dchelimsky dchelimsky ci: relax rake version constraint 3aa7c98
Commits on May 22, 2011
@justinko justinko Refactor any_instance to be instance agnostic - Closes #58 8e8e62f
@justinko justinko Merge branch 'any_instance' 09e53d2
Commits on May 25, 2011
@justinko justinko ew no more hashitis 7b4fe58
@justinko justinko more cleanup f8ba23d
@justinko justinko cleanup f492200
@justinko justinko more cleanup 1da7c41
@justinko justinko More module scoping for Ruby 1.9.1 e21b5d1
Commits on May 27, 2011
@justinko justinko Support for passing a hash to stub for any_instance. Closes #61 a0c14c9
@justinko justinko changelog 150a933
@justinko justinko combine invocation orders 0e17c96
Commits on May 28, 2011
@justinko justinko Use stub, not stub! f523e3c
@dchelimsky dchelimsky dev: add task to remove generated rbc files bcb76da
@dchelimsky dchelimsky bump to rake 0.9 af5a421
@dchelimsky dchelimsky could just use Ruby (thx mat813) a8ea8c6
Commits on May 30, 2011
@justinko justinko spec to verify that an expectation on a method with a default argumen…
…t outputs the correct message.

Closes #62
Commits on May 31, 2011
@justinko justinko Restore @kaiwren any_instance implementation. 628eb91
@kaiwren kaiwren Merge branch 'master' of git:// de93b40
@kaiwren kaiwren split any_instance into multiple files and get to a green build as pr…
…ep to replicate issue #58
@kaiwren kaiwren Added specs replicating issue #58 27367ce
@dchelimsky dchelimsky dev: constrain cucumber to 0.10.2 since 0.10.3 included breaking changes aff2f95
Commits on Jun 02, 2011
@dchelimsky dchelimsky relish docs e8994a7
Commits on Jun 08, 2011
@kaiwren kaiwren Looks like we've got issue #58 solved except the tests don't match th…
…e exception raised
Commits on Jun 10, 2011
@Mik-die Mik-die fixed bug, when respond_to? returns true for method :to_ary, and then…
…, when this method calls, raise NoMethodError. For example, at this point:
@Mik-die Mik-die Mock doesn't respond to :to_ary 918c32f
Commits on Jun 11, 2011
@justinko justinko Merge pull request #63 from Mik-die/patch-1
respond_to? returns true for :to_ary, but call of :to_ary raises NoMethodError
@justinko justinko Don't need "be_" e64fad4
@justinko justinko changelog 4e28546
@dchelimsky dchelimsky ignore .rbc files 0fd2662
@dchelimsky dchelimsky dev: lock gem versions - rake-0.9.2, aruba-0.3.6 c76eb8a
@dchelimsky dchelimsky ci: tell travis to run bin/rake acb2f54
@dchelimsky dchelimsky dev:clean up Rakefile 0e88ecf
@dchelimsky dchelimsky dev: ficks taipoh e96faf3
@dchelimsky dchelimsky dev: add rdoc to Gemfile 41e56e3
@dchelimsky dchelimsky dev: lock the gherkin version 6f75d7f
@dchelimsky dchelimsky dev: remove dep on rdoc 2c55d9a
@dchelimsky dchelimsky dev: git ignore yard artifacts 103238d
@dchelimsky dchelimsky update binstubs 29f470e
Commits on Jun 12, 2011
@kaiwren kaiwren Merge to master 8f16765
Commits on Jun 13, 2011
@myronmarston myronmarston Use a better method of detecting psych.
The psych/syck specs were failing on 1.9.1 on travis ci.  You can compile ruby with the libyaml option but not actually have psych compiled in, apparently.
@dchelimsky dchelimsky dev: remove autotest/discover 7f0448e
@dchelimsky dchelimsky dev: remove executables from gemspec 42b2edf
@dchelimsky dchelimsky dev: constrain file list in gemspec 7dd57f4
Commits on Jun 17, 2011
@alindeman alindeman [#58] Ignore the fact that should_receive expectations will fail to b…
…e satisfied in tests that raise errors earlier
@kaiwren kaiwren Merge pull request #4 from alindeman/issue58
Ignore the fact that should_receive expectations will fail to be satisfied in tests that raise errors earlier
@kaiwren kaiwren Merge branch 'issue58' of into …
@kaiwren kaiwren Fixed broken feature related to multiple method stubs and added anoth…
…er for any_instance.stub.with - this should close Issue #58
Commits on Jun 19, 2011
@justinko justinko Merge pull request #65 from c42engineering/issue58
Support for any_instance argument matching. Closes #58
@justinko justinko changelog b970638
Commits on Jun 21, 2011
@dchelimsky dchelimsky ci: exclude local dev gems from travis bundle b9991bd
@dchelimsky dchelimsky dev: bump aruba timeout to 5 seconds f5b226f
@dchelimsky dchelimsky ruby-1.9.1: use fully qualified names in specs c77dbeb
@dchelimsky dchelimsky dev: remove bin dir from git fae8749
Commits on Jun 23, 2011
@dchelimsky dchelimsky bump cukes to 1.0 b6d93c5
@dchelimsky dchelimsky dev: constrain rcov to ruby 1.8 builds 54ec0a1
Commits on Jun 28, 2011
Tibor Claassen Check for #failure_message_for_should or #failure_message instead of …
…#description to detect a matcher.

- #description optional for a matcher and common in other domains
- one of #failure_message_for_should or #failure_message is mandatory
  - #failure_message is acceptable for backward compatibility
- Closes #64
@dchelimsky dchelimsky Changelog 0e482f4
@dchelimsky dchelimsky move Changelog to project root 153d051
Commits on Jul 02, 2011
@dchelimsky dchelimsky dev: reduce warnings aca59bc
@dchelimsky dchelimsky reduce warnings generated by rspec-mocks f04b8bb
Commits on Jul 19, 2011
@kaiwren kaiwren Fixing #67 - unstub support for any_instance 0a7cde5
Commits on Jul 20, 2011
@justinko justinko Merge pull request #68 from c42engineering/Issue67
Fixing #67 - unstub support for any_instance
Commits on Aug 14, 2011
@kaiwren kaiwren Issue #70 add support for #stub_chain to any_instance c6af9f9
@justinko justinko Merge pull request #71 from c42engineering/issue70
Issue #70: add support for #stub_chain to any_instance
@justinko justinko changelog 82e4ff9
Commits on Aug 19, 2011
@alextk alextk use __send__ method instead of send method, to cover cases when targe…
…t object send method is overridden to expose business api
@justinko justinko Merge pull request #74 from alextk/master
Use __send__ method instead of send
@justinko justinko changelog 63ed352
Commits on Aug 20, 2011
@booch booch document stubbing methods with method names and return values passed …
…as a hash
Commits on Aug 24, 2011
@dchelimsky dchelimsky Merge pull request #75 from booch/master
Document stubbing with methods / return values passed as a hash
@dchelimsky dchelimsky doc tweaks/clarification cfa7a96
Commits on Aug 26, 2011
@adomokos adomokos Add new feature for receive_counts on mocks 52daacc
Commits on Sep 02, 2011
@adomokos adomokos Removing incorrect description 14c52b9
@adomokos adomokos Adding new feature - stubbing with arguments 45b3872
@jredville jredville add argument_matchers features for explicit arguments, anything, any_…
…args, and no_args
@jredville jredville Merge branch 'master' of b08c75e
Commits on Sep 03, 2011
@dchelimsky dchelimsky Merge pull request #77 from adomokos/add_receive_count_feature
Add new feature for receive_counts on mocks
Commits on Sep 29, 2011
@dchelimsky dchelimsky improve explanation as to why we raise NoMethodError on to_ary b0ea68d
@dchelimsky dchelimsky ci: stick to rubies supported by travis 66d5295
Commits on Oct 09, 2011
@dchelimsky dchelimsky Merge pull request #80 from adomokos/add_stub_with_arguments_feature
Adding new cuke feature - stubbing with arguments
@dchelimsky dchelimsky Tweak the "stub with arguments" cuke
- #80.
@dchelimsky dchelimsky Merge pull request #81 from jredville/master
add argument_matchers features for explicit arguments, anything, any_args, and no_args
@dchelimsky dchelimsky nav for new features 1018eaf
@dchelimsky dchelimsky this has been moved to features/argument_matchers 3e1bbba
@dchelimsky dchelimsky bump to 2.7.0.rc1 3934ef4
@dchelimsky dchelimsky bump relish version to ~> 0.5.0 1c128a3
@dchelimsky dchelimsky dev: fix relish task 2f7706a
@dchelimsky dchelimsky fix link to full changelog 53b7427
Commits on Oct 12, 2011
@dchelimsky dchelimsky Raise a helpful message on any_instance.stub! (use stub instead)
- Closes #57.
@dchelimsky dchelimsky rdoc tweaks f0f9d4a
Commits on Oct 15, 2011
@kaiwren kaiwren Bug fix: any_instance now properly restores private methods
- Closes #86.
- Fixes #85.
@dchelimsky dchelimsky Changlog for #85 and #86. b3832f5
Commits on Oct 16, 2011
@dchelimsky dchelimsky cleanup and add some rdoc f646743
@dchelimsky dchelimsky update changelog for 2.7.0 release 6a7c51a
@dchelimsky dchelimsky bump version to 2.7.0 19b5646
@dchelimsky dchelimsky fix formatting problems in the changelog fdd3602