Adds event support to the expectation this is only applicable to clr isolations and not to ruby isolations
A description of an expectation. An expectation has the power to call the proxy method or completely ignore it
the arguments that this expectation needs to be constrained by
# File lib/caricature/expectation.rb, line 159
159: def args
160: collected[:args]
161: end
the block that will be used
# File lib/caricature/expectation.rb, line 144
144: def block
145: collected[:block]
146: end
sets the block callback
# File lib/caricature/expectation.rb, line 149
149: def block=(val)
150: collected[:block] = val
151: end
contains the arguments that will be passed on to the block
# File lib/caricature/expectation.rb, line 134
134: def block_args
135: collected[:block_args]
136: end
The block that will be used as value provider for the block in the method
# File lib/caricature/expectation.rb, line 139
139: def block_callback
140: collected[:block_callback]
141: end
indicates whether super needs to be called somewhere
# File lib/caricature/expectation.rb, line 185
185: def call_super?
186: !collected[:super].nil?
187: end
contains the callback if one is given
# File lib/caricature/expectation.rb, line 123
123: def callback
124: collected[:callback]
125: end
the error_args that this expectation will raise an error with
# File lib/caricature/expectation.rb, line 108
108: def error_args
109: collected[:error_args]
110: end
the arguments that will be used for the event
# File lib/caricature/clr/expectation.rb, line 37
37: def event_args
38: evt_ags = collected[:event_args]
39: evt_ags.nil? or evt_ags.empty? ? [nil, System::EventArgs.empty] : evt_ags
40: end
the block that will be used# the block that will be used
# File lib/caricature/clr/expectation.rb, line 43
43: def event_handler
44: collected[:event_handler] || lambda { |s,e| }
45: end
the block that will be used
# File lib/caricature/clr/expectation.rb, line 32
32: def event_name
33: collected[:event_name]
34: end
# File lib/caricature/clr/expectation.rb, line 72
72: def event_recorder(&b)
73: @event_recorder = b
74: end
the events attached to the context
# File lib/caricature/clr/expectation.rb, line 48
48: def events
49: collected[:events] ||= {}
50: end
Set the registered events for this expectation
# File lib/caricature/clr/expectation.rb, line 53
53: def events=(evts)
54: collected[:events]=evts
55: end
executes this expectation with its configuration
# File lib/caricature/expectation.rb, line 205
205: def execute(*margs,&b)
206: ags = any_args? ? :any : (margs.empty? ? collected[:args] : margs)
207: do_raise_error
208: do_callback(ags)
209: do_block_callback(&b)
210: do_event_raise if respond_to?(:events)
211:
212: return collected[:return_callback].call(*margs) if has_return_callback?
213: return return_value if has_return_value?
214: nil
215: end
indicates whether this expectation has a block as value provider for the method call block
# File lib/caricature/expectation.rb, line 195
195: def has_block_callback?
196: !collected[:block_callback].nil?
197: end
indicates whether this expecation has a callback it needs to execute
# File lib/caricature/expectation.rb, line 190
190: def has_callback?
191: !collected[:callback].nil?
192: end
indicates whether this expecation will raise an event.
# File lib/caricature/expectation.rb, line 170
170: def has_error_args?
171: !collected[:error_args].nil?
172: end
indicates whether this expectation has an event handler to be called
# File lib/caricature/clr/expectation.rb, line 63
63: def has_event_handler?
64: !!collected[:event_handler]
65: end
a flag to indicate it has a return value callback
# File lib/caricature/expectation.rb, line 200
200: def has_return_callback?
201: !collected[:return_callback].nil?
202: end
indicates whether this expectation will return a value.
# File lib/caricature/expectation.rb, line 175
175: def has_return_value?
176: !collected[:return_value].nil?
177: end
gets the method_name to which this expectation needs to listen to
# File lib/caricature/expectation.rb, line 154
154: def method_name
155: collected[:method_name]
156: end
indicates whether this expectation has an event that needs to be raised
# File lib/caricature/clr/expectation.rb, line 58
58: def raises_event?
59: !!collected[:event_name]
60: end
indicates whether to raise the registered event handlers
# File lib/caricature/clr/expectation.rb, line 68
68: def raises_registered?
69: !!collected[:raise_subscriptions]
70: end
contains the callback that is used to return the value when this expectation is executed
# File lib/caricature/expectation.rb, line 129
129: def return_callback
130: collected[:return_callback]
131: end
the value that this expecation will return when executed
# File lib/caricature/expectation.rb, line 113
113: def return_value
114: collected[:return_value]
115: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.