The recorder that will collect method calls and provides an interface for finding those recordings
indexer that gives you access to the recorded method by method name
# File lib/caricature/method_call_recorder.rb, line 118 def [](method_name) method_calls[method_name.to_s.to_sym] end
records a method call or increments the count of how many times this method was called.
# File lib/caricature/method_call_recorder.rb, line 99 def record_call(method_name, *args, &block) mn_sym = method_name.to_s.to_sym method_calls[mn_sym] ||= MethodCallRecording.new method_name mc = method_calls[mn_sym] mc.count += 1 mc.add_argument_variation args, block end
returns the number of different methods that has been recorderd
# File lib/caricature/method_call_recorder.rb, line 123 def size @method_calls.size end
returns whether the method was actually called with the specified constraints
# File lib/caricature/method_call_recorder.rb, line 108 def was_called?(method_name, *args) mc = method_calls[method_name.to_s.to_sym] if mc return mc.find_argument_variations(args).first == args else return !!mc end end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.