class RSpec::Mocks::InstanceMethodReference
@private
Private Instance Methods
find_method(mod)
click to toggle source
# File lib/rspec/mocks/method_reference.rb, line 124 def find_method(mod) mod.dup.instance_method(@method_name) end
method_defined?(mod)
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?
method_implemented?(mod)
click to toggle source
# File lib/rspec/mocks/method_reference.rb, line 106 def method_implemented?(mod) MethodReference.method_defined_at_any_visibility?(mod, @method_name) end
Also aliased as: method_defined?
visibility_from(mod)
click to toggle source
# File lib/rspec/mocks/method_reference.rb, line 133 def visibility_from(mod) MethodReference.instance_method_visibility_for(mod, @method_name) end