Describes a verification of a method call. This corresponds kind of to an assertion
Initializes a new instance of a Verification
# File lib/caricature/clr/event_verification.rb, line 8
8: def initialize(event_name, recorder, mode=:instance)
9: @event_name, @args, @any_args, @recorder, @mode = event_name, [], true, recorder, mode
10: init_plugin
11: end
allow any arguments ignore the argument constraint
# File lib/caricature/clr/event_verification.rb, line 31
31: def allow_any_arguments
32: @any_args = true
33: self
34: end
indicates whether this verification can be for any arguments
# File lib/caricature/clr/event_verification.rb, line 18
18: def any_args?
19: @any_args
20: end
# File lib/caricature/clr/event_verification.rb, line 41
41: def error
42: @recorder.event_error
43: end
# File lib/caricature/clr/event_verification.rb, line 13
13: def init_plugin
14:
15: end
figure out if this argument variation matches the provided args.
# File lib/caricature/clr/event_verification.rb, line 37
37: def matches?(event_name, *args)
38: @event_name == event_name and (any_args? or @args == args)
39: end
indicate that this event verification is successful
# File lib/caricature/bacon/integration.rb, line 56
56: def successful?
57: a = any_args? ? [:any] : @args
58: res = @recorder.event_raised?(@event_name, @mode, *a)
59: raise Caricature::ArgumentMatchError.new(:failed, self.error) unless res
60: res
61: end
indicate that this method verification is successful
# File lib/caricature/clr/event_verification.rb, line 46
46: def successful?
47: a = any_args? ? [:any] : @args
48: begin
49: @recorder.event_raised?(@event_name, @mode, *a)
50: rescue ArgumentError
51: false
52: end
53: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.