class Shoulda::Matchers::Doublespeak::ObjectDouble
@private
Attributes
Public Class Methods
Source
# File lib/shoulda/matchers/doublespeak/object_double.rb, line 8 def initialize @calls = [] @calls_by_method_name = {} end
Public Instance Methods
Source
# File lib/shoulda/matchers/doublespeak/object_double.rb, line 13 def calls_to(method_name) @calls_by_method_name[method_name] || [] end
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
Source
# File lib/shoulda/matchers/doublespeak/object_double.rb, line 17 def respond_to?(_name, _include_private = nil) true end
Source
# File lib/shoulda/matchers/doublespeak/object_double.rb, line 21 def respond_to_missing?(_name, _include_all) true end