Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
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.
...
Checking mergeability… Don’t worry, you can still create the pull request.
  • 1 commit
  • 1 file changed
  • 0 commit comments
  • 1 contributor
Commits on Apr 24, 2012
Jared Grippe and Rex Chung and Tim James added a failing test for a case when RR.mock breaks objects that use …
…method_missing like Redis::Namespace
56d2a06
Showing with 22 additions and 0 deletions.
  1. +22 −0 spec/rr/double_injection/double_injection_spec.rb
View
22 spec/rr/double_injection/double_injection_spec.rb
@@ -91,6 +91,28 @@ def foobar
subject.methods.should_not include('foobar')
end
end
+
+ end
+
+ context "when the subject is using method missing" do
+ it "properly resets the mocked method" do
+ delegator = Class.new{
+ def initialize other
+ @other = other
+ end
+ def method_missing method, *args, &block
+ @other.send(method, *args, &block)
+ end
+ }
+ array_delegator = delegator.new([1,2,3])
+
+ array_delegator.size.should == 3
+ mock(array_delegator).size{ 12 }
+ array_delegator.size.should == 12
+ RR.reset
+ array_delegator.size.should == 3
+ end
+
end
context "when the subject redefines respond_to?" do

No commit comments for this range

Something went wrong with that request. Please try again.