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 21 def method_missing(method_name, *args, &block) calls << MethodCallWithName.new(method_name, args, block) (calls_by_method_name[method_name] ||= []) << MethodCall.new(args, block) 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