class Shoulda::Matchers::Doublespeak::ObjectDouble

@private

Attributes

calls[R]
calls_by_method_name[R]

Public Class Methods

new() click to toggle source
# File lib/shoulda/matchers/doublespeak/object_double.rb, line 8
def initialize
  @calls = []
  @calls_by_method_name = {}
end

Public Instance Methods

calls_to(method_name) click to toggle source
# File lib/shoulda/matchers/doublespeak/object_double.rb, line 13
def calls_to(method_name)
  @calls_by_method_name[method_name] || []
end
method_missing(method_name, *args, &block) click to toggle source
# File lib/shoulda/matchers/doublespeak/object_double.rb, line 25
def method_missing(method_name, *args, &block)
  call = MethodCall.new(
    method_name: method_name,
    args: args,
    block: block,
    caller: ::Kernel.caller
  )
  calls << call
  (calls_by_method_name[method_name] ||= []) << call
  nil
end
respond_to?(name, include_private = nil) click to toggle source
# File lib/shoulda/matchers/doublespeak/object_double.rb, line 17
def respond_to?(name, include_private = nil)
  true
end
respond_to_missing?(name, include_all) click to toggle source
# File lib/shoulda/matchers/doublespeak/object_double.rb, line 21
def respond_to_missing?(name, include_all)
  true
end