Class/Module Index [+]

Quicksearch

RSpec::Mocks::VerifyingDouble

@private

Public Class Methods

new(*args) click to toggle source
# File lib/rspec/mocks/verifying_double.rb, line 51
def initialize(*args)
  super
  @__sending_message = nil
end

Public Instance Methods

__send__(name, *args, &block) click to toggle source
# File lib/rspec/mocks/verifying_double.rb, line 39
def __send__(name, *args, &block)
  @__sending_message = name
  super
ensure
  @__sending_message = nil
end
method_missing(message, *args, &block) click to toggle source
# File lib/rspec/mocks/verifying_double.rb, line 22
def method_missing(message, *args, &block)
  # Null object conditional is an optimization. If not a null object,
  # validity of method expectations will have been checked at definition
  # time.
  if null_object?
    if @__sending_message == message
      __mock_proxy.ensure_implemented(message)
    else
      __mock_proxy.ensure_publicly_implemented(message, self)
    end
  end

  super
end
respond_to?(message, include_private=false) click to toggle source
# File lib/rspec/mocks/verifying_double.rb, line 9
def respond_to?(message, include_private=false)
  return super unless null_object?

  method_ref = __mock_proxy.method_reference[message]

  return case method_ref.visibility
    when :public    then true
    when :private   then include_private
    when :protected then include_private || RUBY_VERSION.to_f < 2.0
    else !method_ref.unimplemented?
  end
end
send(name, *args, &block) click to toggle source
# File lib/rspec/mocks/verifying_double.rb, line 47
def send(name, *args, &block)
  __send__(name, *args, &block)
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.