Permalink
Browse files

- Fixed issue with DoubleInjections binding to objects overriding the…

… method method.
  • Loading branch information...
1 parent fcf922d commit eac6a3ac53354bf56d750b364b675be678cdc8c5 Brian Takita committed Feb 16, 2010
Showing with 6 additions and 2 deletions.
  1. +3 −0 CHANGES
  2. +3 −2 lib/rr/injections/double_injection.rb
View
@@ -1,3 +1,6 @@
+- Fixed issue with DoubleInjections binding to objects overriding the method method.
+
+0.10.6
- Added MIT license
- Fixed Bug - dont_allow doesn't work when it follows stub (http://github.com/btakita/rr/issues#issue/20)
- Fixed exception with DoubleInjections on proxy objects (http://github.com/btakita/rr/issues#issue/24)
@@ -100,8 +100,9 @@ def bypass_bound_method
protected
def subject_is_proxy_for_method?(method_name)
- method_owner = @subject.method(method_name).owner
- !(subject_class.object_id == method_owner.object_id || subject_class.ancestors.include?(method_owner))
+ subject_eigen = (class << @subject; self; end)
+ method_owner = subject_eigen.instance_methods.include?(method_name.to_s) ? subject_eigen.instance_method(method_name).owner : nil
+ !method_owner || !(subject_class.object_id == method_owner.object_id || subject_class.ancestors.include?(method_owner))
end
def deferred_bind_method

0 comments on commit eac6a3a

Please sign in to comment.