A recording that represents a method call it contains argument variations that can be matched too
Initializes a new instance of a method call recording every time a method gets called in an isolated object this gets stored in the method call recorder It expects a method_name at the very least.
# File lib/caricature/method_call_recorder.rb, line 56
56: def initialize(method_name, count=0)
57: @method_name = method_name
58: @count = count
59: @variations = []
60: end
add an argument variation
# File lib/caricature/method_call_recorder.rb, line 73
73: def add_argument_variation(args, block)
74: variation = find_argument_variations args
75: @variations << ArgumentRecording.new(args, @variations.size+1, block) if variation == []
76: end
add args
# File lib/caricature/method_call_recorder.rb, line 63
63: def args
64: @variations
65: end
finds an argument variation that matches the provided args
# File lib/caricature/method_call_recorder.rb, line 79
79: def find_argument_variations(args)
80: return @variations if args.first.is_a?(Symbol) and args.first == :any
81: @variations.select { |ar| ar.args == args }
82: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.