class RSpec::Mocks::MethodDouble

Public Instance Methods

current_object() click to toggle source
# File lib/rspec/radar.rb, line 16
def current_object
  instance_variable_get(("@object").intern)
end
visibility() click to toggle source
# File lib/rspec/radar.rb, line 20
def visibility
  if TestDouble === self.current_object
    'public'
  elsif object_singleton_class.private_method_defined?(self.method_name)
    'private'
  elsif object_singleton_class.protected_method_defined?(self.method_name)
    'protected'
  elsif object_singleton_class.public_method_defined?(self.method_name)
    'public'
  elsif self.current_object.respond_to? self.method_name
    'public'
  else
    raise Radar::UndefinedMethodError, "Attempt to stub unknown method '#{self.method_name}'"
  end
end