class RSpec::Mocks::InstanceMethodReference
@private
Private Instance Methods
Source
# File lib/rspec/mocks/method_reference.rb, line 134 def find_method(mod) mod.dup.instance_method(@method_name) end
Ideally, we’d use ‘respond_to?` for `method_implemented?` but we need a reference to an instance to do that and we don’t have one. Note that we may get false negatives: if the method is implemented via ‘method_missing`, we’ll return ‘false` even though it meets our definition of “implemented”. However, it’s the best we can do.
Alias for: method_implemented?
Source
# File lib/rspec/mocks/method_reference.rb, line 116 def method_implemented?(mod) MethodReference.method_defined_at_any_visibility?(mod, @method_name) end
Also aliased as: method_defined?
Source
# File lib/rspec/mocks/method_reference.rb, line 143 def visibility_from(mod) MethodReference.instance_method_visibility_for(mod, @method_name) end