lib/rspec/mocks/instance_method_stasher.rb in rspec-mocks-3.0.0.beta1 vs lib/rspec/mocks/instance_method_stasher.rb in rspec-mocks-3.0.0.beta2
- old
+ new
@@ -52,11 +52,11 @@
end
# @private
def stash
return if !method_defined_directly_on_klass?
- @original_method ||= ::RSpec::Mocks.method_handle_for(@object, @method)
+ @original_method ||= ::RSpec::Support.method_handle_for(@object, @method)
end
# @private
def restore
return unless @original_method
@@ -77,11 +77,11 @@
method_defined_on_klass? && method_owned_by_klass?
end
# @private
def method_defined_on_klass?(klass = @klass)
- klass.method_defined?(@method) || klass.private_method_defined?(@method)
+ MethodReference.method_defined_at_any_visibility?(klass, @method)
end
def method_owned_by_klass?
owner = @klass.instance_method(@method).owner
@@ -107,6 +107,5 @@
owner == @klass || !(method_defined_on_klass?(owner))
end
end
end
end
-