Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Commits on Apr 23, 2011
  1. @kaiwren @dchelimsky

    Support multiple calls to any_instance in the same example.

    kaiwren authored dchelimsky committed
    - Closes #54.
Commits on Apr 17, 2011
  1. @dchelimsky

    Mock#to_ary raises a NoMethodError

    dchelimsky authored
    - supports Array#flatten with a Mock in the Array
    - Closes #31.
  2. @dchelimsky
  3. @dchelimsky
  4. @kaiwren @dchelimsky

    Ensure that any_instance expectations are properly cleaned up between…

    kaiwren authored dchelimsky committed
    … examples.
    
    - Closes #52.
Commits on Apr 10, 2011
  1. @dchelimsky
Commits on Apr 2, 2011
  1. @dchelimsky
Commits on Mar 31, 2011
  1. @dchelimsky

    Changlog and some minor tweaks

    dchelimsky authored
    - removed unnecessary conditional
    - reduced nesting in any_instance_spec
Commits on Mar 29, 2011
  1. @kaiwren
  2. @kaiwren
  3. @kaiwren
  4. @dchelimsky @kaiwren

    Expect (failing) that any_instance.should_receive should fail if no

    dchelimsky authored kaiwren committed
    instance is created during the course of an example.
  5. @alindeman @kaiwren

    Use #method_defined? instead of #instance_methods.include?.

    alindeman authored kaiwren committed
    - All specs now pass on MRI 1.8.7 and MRI 1.9.2.
  6. @kaiwren

    Add support for any_instance:

    kaiwren authored
    - 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.
Commits on Mar 28, 2011
  1. @dchelimsky

    Treat block passed to `with` as a dynamic matcher or a return value, but

    dchelimsky authored
    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 foo.bar(:arg), 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.
  2. @dchelimsky
Commits on Mar 23, 2011
  1. @kaiwren @justinko
Commits on Feb 26, 2011
  1. @dchelimsky

    move some specs around

    dchelimsky authored
Commits on Feb 20, 2011
  1. @myronmarston

    Fix yaml serialization when using Psych.

    myronmarston authored
    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.
  2. @myronmarston

    Allow users to specify return values by passing a block to #at_least,…

    myronmarston authored
    … #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.
Commits on Feb 12, 2011
  1. @dchelimsky

    fix bug in which multiple chains with shared messages ending in hashes

    dchelimsky authored
    failed to return the correct value
    
    - also documented stub_chain(:a, :b => :c) format in feature
Commits on Feb 5, 2011
  1. @txus @dchelimsky

    Fix failure message when message received with incorrect args.

    txus authored dchelimsky committed
    - Closes #34.
Commits on Jan 16, 2011
  1. @dnurzynski @dchelimsky

    Fix bug: Message expectation counts don't work in combination with a …

    dnurzynski authored dchelimsky committed
    …stub
    
    - Closes #28.
    - Closes #33.
Commits on Dec 11, 2010
  1. @myronmarston @dchelimsky

    Fix our Marshal extension so that it does not interfere with objects …

    myronmarston authored dchelimsky committed
    …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.
Commits on Dec 7, 2010
  1. @dchelimsky
Commits on Nov 26, 2010
  1. @dchelimsky

    Fix bug where obj.should_receive(:foo).with(stub.as_null_object) would

    dchelimsky authored
    pass with a false positive.
    
    - Closes #233.
Commits on Nov 6, 2010
  1. @txus @dchelimsky

    Fix Marshal serialization of stubbed objects

    txus authored dchelimsky committed
    - Closes #27.
Commits on Oct 18, 2010
  1. @txus @dchelimsky

    15719 already fixed in stubbed_message_expectations_spec.rb

    txus authored dchelimsky committed
    - Closes #26.
Commits on Oct 9, 2010
  1. @myronmarston @dchelimsky

    Allow specs to run on ruby 1.8.6.

    myronmarston authored dchelimsky committed
  2. @myronmarston @dchelimsky

    Added spec demonstrating mock return value for an edge case.

    myronmarston authored dchelimsky committed
    When a method has been stubbed previously to return a certain value (say, in a before(:each)), and then mocked w/o a return value (say, in a spec, to ensure a method was called), the stubbed value should still be returned.
Commits on Oct 3, 2010
  1. @dchelimsky

    Raise with unexpected args message instead of NoMethodError when a stub

    dchelimsky authored
    is specified with args but received with different args.
Commits on Oct 2, 2010
  1. @dchelimsky
  2. @dchelimsky
  3. @myronmarston @dchelimsky

    Fixed YAML serialization of a stubbed object.

    myronmarston authored dchelimsky committed
    Previously, the mock proxy would be serialized when #to_yaml is called on a stubbed object.  The mock proxy includes a reference to a proc.  When the yaml string is deserialized with YAML.load, you'd get an "allocator undefined for Proc" TypeError.
    
    This fix prevents stubbing from setting any new instance variables on the stubbed object, so that the YAMl serialization is not affected.
  4. @dchelimsky
Something went wrong with that request. Please try again.