Permalink
Browse files

Add explanatory comments for my last commit.

  • Loading branch information...
1 parent 0f77e46 commit d2ef0561781e1199ae9a01095c3083ba475600c1 @myronmarston myronmarston committed Nov 25, 2012
Showing with 7 additions and 0 deletions.
  1. +7 −0 lib/rspec/mocks/method_double.rb
@@ -46,6 +46,13 @@ def original_method
# Example: a singleton method defined on @object
method_handle_for(@object, @method_stasher.stashed_method_name)
elsif meth = original_unrecorded_any_instance_method
+ # Example: a method that has been mocked through
+ # klass.any_instance.should_receive(:msg).and_call_original
+ # any_instance.should_receive(:msg) causes the method to be
+ # replaced with a proxy method, and then `and_call_original`
+ # is recorded and played back on the object instance. We need
+ # special handling here to get a handle on the original method
+ # object rather than the proxy method.
meth
else
begin

0 comments on commit d2ef056

Please sign in to comment.