A description of an expectation. An expectation has the power to call the proxy method or completely ignore it
Initializes a new instance of an expectation
# File lib/caricature/expectation.rb, line 105
105: def initialize(method_name, args, error_args, return_value, super_mode, callback)
106: @method_name, @args, @error_args, @return_value, @super, @callback =
107: method_name, args, error_args, return_value, super_mode, callback
108: @any_args = true
109: end
indicates whether super needs to be called somewhere
# File lib/caricature/expectation.rb, line 127
127: def call_super?
128: !@super.nil?
129: end
executes this expectation with its configuration
# File lib/caricature/expectation.rb, line 137
137: def execute(*margs)
138: ags = any_args? ? (margs.empty? ? :any : margs) : args
139: actual_raise *@error_args if has_error_args?
140: callback.call(*ags) if has_callback?
141: return return_value if has_return_value?
142: nil
143: end
indicates whether this expecation has a callback it needs to execute
# File lib/caricature/expectation.rb, line 132
132: def has_callback?
133: !@callback.nil?
134: end
indicates whether this expecation will raise an event.
# File lib/caricature/expectation.rb, line 112
112: def has_error_args?
113: !@error_args.nil?
114: end
indicates whether this expectation will return a value.
# File lib/caricature/expectation.rb, line 117
117: def has_return_value?
118: !@return_value.nil?
119: end
(Not documented)
# File lib/caricature/expectation.rb, line 149
149: def inspect
150: to_s
151: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.