caricature 0.5.0 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (51) hide show
  1. data/VERSION +1 -1
  2. data/caricature.gemspec +5 -2
  3. data/doc/Array.html +2 -2
  4. data/doc/Caricature/ArgumentRecording.html +4 -4
  5. data/doc/Caricature/ClrClassMessenger.html +22 -22
  6. data/doc/Caricature/ClrInterfaceMessenger.html +19 -19
  7. data/doc/Caricature/ClrIsolator.html +1 -1
  8. data/doc/Caricature/Expectation.html +12 -12
  9. data/doc/Caricature/ExpectationBuilder.html +6 -6
  10. data/doc/Caricature/ExpectationSyntax.html +10 -10
  11. data/doc/Caricature/Expectations.html +19 -16
  12. data/doc/Caricature/Interception/ClassMethods.html +120 -2
  13. data/doc/Caricature/Interception.html +130 -12
  14. data/doc/Caricature/Isolation.html +207 -22
  15. data/doc/Caricature/Isolator.html +18 -18
  16. data/doc/Caricature/Messenger.html +87 -9
  17. data/doc/Caricature/MethodCallRecorder.html +20 -56
  18. data/doc/Caricature/MethodCallRecording.html +10 -10
  19. data/doc/Caricature/RubyIsolator.html +13 -13
  20. data/doc/Caricature/RubyMessenger.html +24 -23
  21. data/doc/Caricature/RubyObjectDescriptor.html +4 -4
  22. data/doc/Caricature/TypeDescriptor.html +4 -4
  23. data/doc/Caricature/Verification.html +16 -16
  24. data/doc/Caricature.html +2 -2
  25. data/doc/Class.html +4 -4
  26. data/doc/Hash.html +2 -2
  27. data/doc/Module.html +4 -4
  28. data/doc/Object.html +6 -6
  29. data/doc/String.html +4 -4
  30. data/doc/System/String.html +4 -4
  31. data/doc/System/Type.html +4 -4
  32. data/doc/created.rid +1 -1
  33. data/doc/index.html +102 -82
  34. data/doc/lib/caricature/clr/isolator_rb.html +1 -1
  35. data/doc/lib/caricature/clr/messenger_rb.html +1 -1
  36. data/doc/lib/caricature/clr_rb.html +1 -1
  37. data/doc/lib/caricature/expectation_rb.html +1 -1
  38. data/doc/lib/caricature/isolation_rb.html +1 -1
  39. data/doc/lib/caricature/isolator_rb.html +1 -1
  40. data/doc/lib/caricature/messenger_rb.html +52 -0
  41. data/doc/lib/caricature/method_call_recorder_rb.html +1 -1
  42. data/doc/lib/caricature/verification_rb.html +1 -1
  43. data/doc/lib/caricature_rb.html +1 -1
  44. data/lib/caricature/clr/aspnet_mvc.rb +51 -0
  45. data/lib/caricature/clr/isolator.rb +2 -1
  46. data/lib/caricature/expectation.rb +4 -3
  47. data/lib/caricature/method_call_recorder.rb +2 -2
  48. data/lib/caricature/verification.rb +1 -1
  49. data/pkg/caricature-0.5.0.gem +0 -0
  50. data/spec/isolator_spec.rb +7 -1
  51. metadata +5 -2
@@ -59,15 +59,13 @@
59
59
  <h3 class="section-header">Methods</h3>
60
60
  <ul class="link-list">
61
61
 
62
- <li><a href="#M000069">::new</a></li>
62
+ <li><a href="#M000078">::new</a></li>
63
63
 
64
- <li><a href="#M000072">#[]</a></li>
64
+ <li><a href="#M000080">#record_call</a></li>
65
65
 
66
- <li><a href="#M000070">#record_call</a></li>
66
+ <li><a href="#M000083">#size</a></li>
67
67
 
68
- <li><a href="#M000074">#size</a></li>
69
-
70
- <li><a href="#M000071">#was_called?</a></li>
68
+ <li><a href="#M000082">#was_called?</a></li>
71
69
 
72
70
  </ul>
73
71
  </div>
@@ -229,7 +227,7 @@ key
229
227
 
230
228
 
231
229
  <div id="new-method" class="method-detail ">
232
- <a name="M000069"></a>
230
+ <a name="M000078"></a>
233
231
 
234
232
  <div class="method-heading">
235
233
 
@@ -252,9 +250,9 @@ recorder
252
250
  <div class="method-source-code"
253
251
  id="new-source">
254
252
  <pre>
255
- <span class="ruby-comment cmt"># File lib/caricature/method_call_recorder.rb, line 94</span>
253
+ <span class="ruby-comment cmt"># File lib/caricature/method_call_recorder.rb, line 95</span>
256
254
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>
257
- <span class="ruby-ivar">@method_calls</span> = {}
255
+ <span class="ruby-ivar">@method_calls</span> = {<span class="ruby-identifier">:instance</span> =<span class="ruby-operator">&gt;</span> {}, <span class="ruby-identifier">:class</span> =<span class="ruby-operator">&gt;</span> {} }
258
256
  <span class="ruby-keyword kw">end</span></pre>
259
257
  </div>
260
258
 
@@ -270,47 +268,13 @@ recorder
270
268
  <h3 class="section-header">Public Instance Methods</h3>
271
269
 
272
270
 
273
- <div id="--method" class="method-detail ">
274
- <a name="M000072"></a>
275
-
276
- <div class="method-heading">
277
-
278
- <span class="method-name">[]</span><span
279
- class="method-args">(method_name)</span>
280
- <span class="method-click-advice">click to toggle source</span>
281
-
282
- </div>
283
-
284
- <div class="method-description">
285
-
286
- <p>
287
- indexer that gives you access to the recorded method by method name
288
- </p>
289
-
290
-
291
-
292
- <div class="method-source-code"
293
- id="--source">
294
- <pre>
295
- <span class="ruby-comment cmt"># File lib/caricature/method_call_recorder.rb, line 118</span>
296
- <span class="ruby-keyword kw">def</span> <span class="ruby-operator">[]</span>(<span class="ruby-identifier">method_name</span>)
297
- <span class="ruby-identifier">method_calls</span>[<span class="ruby-identifier">method_name</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">to_sym</span>]
298
- <span class="ruby-keyword kw">end</span></pre>
299
- </div>
300
-
301
- </div>
302
-
303
-
304
- </div>
305
-
306
-
307
271
  <div id="record-call-method" class="method-detail ">
308
- <a name="M000070"></a>
272
+ <a name="M000080"></a>
309
273
 
310
274
  <div class="method-heading">
311
275
 
312
276
  <span class="method-name">record_call</span><span
313
- class="method-args">(method_name, *args, &block)</span>
277
+ class="method-args">(method_name, mode=:instance, *args, &block)</span>
314
278
  <span class="method-click-advice">click to toggle source</span>
315
279
 
316
280
  </div>
@@ -327,11 +291,11 @@ was called.
327
291
  <div class="method-source-code"
328
292
  id="record-call-source">
329
293
  <pre>
330
- <span class="ruby-comment cmt"># File lib/caricature/method_call_recorder.rb, line 99</span>
331
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">record_call</span>(<span class="ruby-identifier">method_name</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">args</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
294
+ <span class="ruby-comment cmt"># File lib/caricature/method_call_recorder.rb, line 100</span>
295
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">record_call</span>(<span class="ruby-identifier">method_name</span>, <span class="ruby-identifier">mode</span>=<span class="ruby-identifier">:instance</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">args</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
332
296
  <span class="ruby-identifier">mn_sym</span> = <span class="ruby-identifier">method_name</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">to_sym</span>
333
- <span class="ruby-identifier">method_calls</span>[<span class="ruby-identifier">mn_sym</span>] <span class="ruby-operator">||=</span> <span class="ruby-constant">MethodCallRecording</span>.<span class="ruby-identifier">new</span> <span class="ruby-identifier">method_name</span>
334
- <span class="ruby-identifier">mc</span> = <span class="ruby-identifier">method_calls</span>[<span class="ruby-identifier">mn_sym</span>]
297
+ <span class="ruby-identifier">method_calls</span>[<span class="ruby-identifier">mode</span>][<span class="ruby-identifier">mn_sym</span>] <span class="ruby-operator">||=</span> <span class="ruby-constant">MethodCallRecording</span>.<span class="ruby-identifier">new</span> <span class="ruby-identifier">method_name</span>
298
+ <span class="ruby-identifier">mc</span> = <span class="ruby-identifier">method_calls</span>[<span class="ruby-identifier">mode</span>][<span class="ruby-identifier">mn_sym</span>]
335
299
  <span class="ruby-identifier">mc</span>.<span class="ruby-identifier">count</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
336
300
  <span class="ruby-identifier">mc</span>.<span class="ruby-identifier">add_argument_variation</span> <span class="ruby-identifier">args</span>, <span class="ruby-identifier">block</span>
337
301
  <span class="ruby-keyword kw">end</span></pre>
@@ -344,7 +308,7 @@ was called.
344
308
 
345
309
 
346
310
  <div id="size-method" class="method-detail ">
347
- <a name="M000074"></a>
311
+ <a name="M000083"></a>
348
312
 
349
313
  <div class="method-heading">
350
314
 
@@ -365,7 +329,7 @@ returns the number of different methods that has been recorderd
365
329
  <div class="method-source-code"
366
330
  id="size-source">
367
331
  <pre>
368
- <span class="ruby-comment cmt"># File lib/caricature/method_call_recorder.rb, line 123</span>
332
+ <span class="ruby-comment cmt"># File lib/caricature/method_call_recorder.rb, line 124</span>
369
333
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">size</span>
370
334
  <span class="ruby-ivar">@method_calls</span>.<span class="ruby-identifier">size</span>
371
335
  <span class="ruby-keyword kw">end</span></pre>
@@ -378,12 +342,12 @@ returns the number of different methods that has been recorderd
378
342
 
379
343
 
380
344
  <div id="was-called--method" class="method-detail ">
381
- <a name="M000071"></a>
345
+ <a name="M000082"></a>
382
346
 
383
347
  <div class="method-heading">
384
348
 
385
349
  <span class="method-name">was_called?</span><span
386
- class="method-args">(method_name, *args)</span>
350
+ class="method-args">(method_name, mode=:instance, *args)</span>
387
351
  <span class="method-click-advice">click to toggle source</span>
388
352
 
389
353
  </div>
@@ -400,9 +364,9 @@ constraints
400
364
  <div class="method-source-code"
401
365
  id="was-called--source">
402
366
  <pre>
403
- <span class="ruby-comment cmt"># File lib/caricature/method_call_recorder.rb, line 108</span>
404
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">was_called?</span>(<span class="ruby-identifier">method_name</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">args</span>)
405
- <span class="ruby-identifier">mc</span> = <span class="ruby-identifier">method_calls</span>[<span class="ruby-identifier">method_name</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">to_sym</span>]
367
+ <span class="ruby-comment cmt"># File lib/caricature/method_call_recorder.rb, line 109</span>
368
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">was_called?</span>(<span class="ruby-identifier">method_name</span>, <span class="ruby-identifier">mode</span>=<span class="ruby-identifier">:instance</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">args</span>)
369
+ <span class="ruby-identifier">mc</span> = <span class="ruby-identifier">method_calls</span>[<span class="ruby-identifier">mode</span>][<span class="ruby-identifier">method_name</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">to_sym</span>]
406
370
  <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">mc</span>
407
371
  <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">mc</span>.<span class="ruby-identifier">find_argument_variations</span>(<span class="ruby-identifier">args</span>).<span class="ruby-identifier">first</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">args</span>
408
372
  <span class="ruby-keyword kw">else</span>
@@ -59,15 +59,15 @@
59
59
  <h3 class="section-header">Methods</h3>
60
60
  <ul class="link-list">
61
61
 
62
- <li><a href="#M000061">::new</a></li>
62
+ <li><a href="#M000070">::new</a></li>
63
63
 
64
- <li><a href="#M000065">#add_argument_variation</a></li>
64
+ <li><a href="#M000074">#add_argument_variation</a></li>
65
65
 
66
- <li><a href="#M000062">#args</a></li>
66
+ <li><a href="#M000071">#args</a></li>
67
67
 
68
- <li><a href="#M000067">#find_argument_variations</a></li>
68
+ <li><a href="#M000076">#find_argument_variations</a></li>
69
69
 
70
- <li><a href="#M000063">#has_argument_variations?</a></li>
70
+ <li><a href="#M000073">#has_argument_variations?</a></li>
71
71
 
72
72
  </ul>
73
73
  </div>
@@ -287,7 +287,7 @@ gets or sets the block for this method call
287
287
 
288
288
 
289
289
  <div id="new-method" class="method-detail ">
290
- <a name="M000061"></a>
290
+ <a name="M000070"></a>
291
291
 
292
292
  <div class="method-heading">
293
293
 
@@ -333,7 +333,7 @@ very least.
333
333
 
334
334
 
335
335
  <div id="add-argument-variation-method" class="method-detail ">
336
- <a name="M000065"></a>
336
+ <a name="M000074"></a>
337
337
 
338
338
  <div class="method-heading">
339
339
 
@@ -368,7 +368,7 @@ add an argument variation
368
368
 
369
369
 
370
370
  <div id="args-method" class="method-detail ">
371
- <a name="M000062"></a>
371
+ <a name="M000071"></a>
372
372
 
373
373
  <div class="method-heading">
374
374
 
@@ -402,7 +402,7 @@ add args
402
402
 
403
403
 
404
404
  <div id="find-argument-variations-method" class="method-detail ">
405
- <a name="M000067"></a>
405
+ <a name="M000076"></a>
406
406
 
407
407
  <div class="method-heading">
408
408
 
@@ -437,7 +437,7 @@ finds an argument variation that matches the provided <tt>args</tt>
437
437
 
438
438
 
439
439
  <div id="has-argument-variations--method" class="method-detail ">
440
- <a name="M000063"></a>
440
+ <a name="M000073"></a>
441
441
 
442
442
  <div class="method-heading">
443
443
 
@@ -59,13 +59,13 @@
59
59
  <h3 class="section-header">Methods</h3>
60
60
  <ul class="link-list">
61
61
 
62
- <li><a href="#M000060">::new</a></li>
62
+ <li><a href="#M000075">::new</a></li>
63
63
 
64
- <li><a href="#M000068">#___super___</a></li>
64
+ <li><a href="#M000081">#___super___</a></li>
65
65
 
66
- <li><a href="#M000066">#create_isolation_for</a></li>
66
+ <li><a href="#M000079">#create_isolation_for</a></li>
67
67
 
68
- <li><a href="#M000064">#initialize_messenger</a></li>
68
+ <li><a href="#M000077">#initialize_messenger</a></li>
69
69
 
70
70
  </ul>
71
71
  </div>
@@ -214,7 +214,7 @@ instance methods that are defined on the class.
214
214
 
215
215
 
216
216
  <div id="new-method" class="method-detail ">
217
- <a name="M000060"></a>
217
+ <a name="M000075"></a>
218
218
 
219
219
  <div class="method-heading">
220
220
 
@@ -235,7 +235,7 @@ implemented template method for creating Ruby isolations
235
235
  <div class="method-source-code"
236
236
  id="new-source">
237
237
  <pre>
238
- <span class="ruby-comment cmt"># File lib/caricature/isolator.rb, line 150</span>
238
+ <span class="ruby-comment cmt"># File lib/caricature/isolator.rb, line 232</span>
239
239
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">context</span>)
240
240
  <span class="ruby-keyword kw">super</span>
241
241
  <span class="ruby-identifier">klass</span> = <span class="ruby-ivar">@context</span>.<span class="ruby-identifier">subject</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-identifier">:class_eval</span>) <span class="ruby-operator">?</span> <span class="ruby-ivar">@context</span>.<span class="ruby-identifier">subject</span> <span class="ruby-operator">:</span> <span class="ruby-ivar">@context</span>.<span class="ruby-identifier">subject</span>.<span class="ruby-identifier">class</span>
@@ -258,7 +258,7 @@ implemented template method for creating Ruby isolations
258
258
 
259
259
 
260
260
  <div id="-super--method" class="method-detail ">
261
- <a name="M000068"></a>
261
+ <a name="M000081"></a>
262
262
 
263
263
  <div class="method-heading">
264
264
 
@@ -279,7 +279,7 @@ access to the proxied subject
279
279
  <div class="method-source-code"
280
280
  id="-super--source">
281
281
  <pre>
282
- <span class="ruby-comment cmt"># File lib/caricature/isolator.rb, line 174</span>
282
+ <span class="ruby-comment cmt"># File lib/caricature/isolator.rb, line 256</span>
283
283
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">___super___</span>
284
284
  <span class="ruby-identifier">isolation_context</span>.<span class="ruby-identifier">instance</span>
285
285
  <span class="ruby-keyword kw">end</span></pre>
@@ -292,7 +292,7 @@ access to the proxied subject
292
292
 
293
293
 
294
294
  <div id="create-isolation-for-method" class="method-detail ">
295
- <a name="M000066"></a>
295
+ <a name="M000079"></a>
296
296
 
297
297
  <div class="method-heading">
298
298
 
@@ -313,7 +313,7 @@ creates the ruby isolator for the specified subject
313
313
  <div class="method-source-code"
314
314
  id="create-isolation-for-source">
315
315
  <pre>
316
- <span class="ruby-comment cmt"># File lib/caricature/isolator.rb, line 164</span>
316
+ <span class="ruby-comment cmt"># File lib/caricature/isolator.rb, line 246</span>
317
317
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">create_isolation_for</span>(<span class="ruby-identifier">subj</span>)
318
318
  <span class="ruby-identifier">imembers</span> = <span class="ruby-ivar">@descriptor</span>.<span class="ruby-identifier">instance_members</span>
319
319
  <span class="ruby-identifier">cmembers</span> = <span class="ruby-ivar">@descriptor</span>.<span class="ruby-identifier">class_members</span>
@@ -342,7 +342,7 @@ creates the ruby isolator for the specified subject
342
342
  <span class="ruby-identifier">define_cmethod</span> <span class="ruby-identifier">mn</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-operator">*</span><span class="ruby-identifier">args</span><span class="ruby-operator">|</span>
343
343
  <span class="ruby-identifier">b</span> = <span class="ruby-keyword kw">nil</span>
344
344
  <span class="ruby-identifier">b</span> = <span class="ruby-constant">Proc</span>.<span class="ruby-identifier">new</span> { <span class="ruby-keyword kw">yield</span> } <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">block_given?</span>
345
- <span class="ruby-identifier">isolation_context</span>.<span class="ruby-identifier">send_message</span>(<span class="ruby-identifier">mn</span>, <span class="ruby-keyword kw">nil</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">args</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">b</span>)
345
+ <span class="ruby-identifier">isolation_context</span>.<span class="ruby-identifier">send_class_message</span>(<span class="ruby-identifier">mn</span>, <span class="ruby-keyword kw">nil</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">args</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">b</span>)
346
346
  <span class="ruby-keyword kw">end</span>
347
347
  <span class="ruby-keyword kw">end</span>
348
348
 
@@ -360,7 +360,7 @@ creates the ruby isolator for the specified subject
360
360
 
361
361
 
362
362
  <div id="initialize-messenger-method" class="method-detail ">
363
- <a name="M000064"></a>
363
+ <a name="M000077"></a>
364
364
 
365
365
  <div class="method-heading">
366
366
 
@@ -381,7 +381,7 @@ initializes the messaging strategy for the isolator
381
381
  <div class="method-source-code"
382
382
  id="initialize-messenger-source">
383
383
  <pre>
384
- <span class="ruby-comment cmt"># File lib/caricature/isolator.rb, line 159</span>
384
+ <span class="ruby-comment cmt"># File lib/caricature/isolator.rb, line 241</span>
385
385
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize_messenger</span>
386
386
  <span class="ruby-ivar">@context</span>.<span class="ruby-identifier">messenger</span> = <span class="ruby-constant">RubyMessenger</span>.<span class="ruby-identifier">new</span> <span class="ruby-ivar">@context</span>.<span class="ruby-identifier">expectations</span>, <span class="ruby-ivar">@subject</span>
387
387
  <span class="ruby-keyword kw">end</span></pre>
@@ -28,8 +28,8 @@
28
28
  <div class="section-body">
29
29
  <ul>
30
30
 
31
- <li><a href="../lib/caricature/messaging_rb.html?TB_iframe=true&amp;height=550&amp;width=785"
32
- class="thickbox" title="lib/caricature/messaging.rb">lib/caricature/messaging.rb</a></li>
31
+ <li><a href="../lib/caricature/messenger_rb.html?TB_iframe=true&amp;height=550&amp;width=785"
32
+ class="thickbox" title="lib/caricature/messenger.rb">lib/caricature/messenger.rb</a></li>
33
33
 
34
34
  </ul>
35
35
  </div>
@@ -59,7 +59,7 @@
59
59
  <h3 class="section-header">Methods</h3>
60
60
  <ul class="link-list">
61
61
 
62
- <li><a href="#M000051">#deliver</a></li>
62
+ <li><a href="#M000061">#internal_deliver</a></li>
63
63
 
64
64
  </ul>
65
65
  </div>
@@ -191,17 +191,17 @@ Encapsulates sending messages to Ruby isolations
191
191
 
192
192
  <!-- Methods -->
193
193
 
194
- <div id="public-instance-method-details" class="method-section section">
195
- <h3 class="section-header">Public Instance Methods</h3>
194
+ <div id="protected-instance-method-details" class="method-section section">
195
+ <h3 class="section-header">Protected Instance Methods</h3>
196
196
 
197
197
 
198
- <div id="deliver-method" class="method-detail ">
199
- <a name="M000051"></a>
198
+ <div id="internal-deliver-method" class="method-detail ">
199
+ <a name="M000061"></a>
200
200
 
201
201
  <div class="method-heading">
202
202
 
203
- <span class="method-name">deliver</span><span
204
- class="method-args">(method_name, return_type, *args, &b)</span>
203
+ <span class="method-name">internal_deliver</span><span
204
+ class="method-args">(mode, method_name, return_type, *args, &b)</span>
205
205
  <span class="method-click-advice">click to toggle source</span>
206
206
 
207
207
  </div>
@@ -209,26 +209,27 @@ Encapsulates sending messages to Ruby isolations
209
209
  <div class="method-description">
210
210
 
211
211
  <p>
212
- deliver the message to the receiving isolation
212
+ implementation of the template method for looking up the expectation and/or
213
+ returning a value
213
214
  </p>
214
215
 
215
216
 
216
217
 
217
218
  <div class="method-source-code"
218
- id="deliver-source">
219
+ id="internal-deliver-source">
219
220
  <pre>
220
- <span class="ruby-comment cmt"># File lib/caricature/messaging.rb, line 29</span>
221
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">deliver</span>(<span class="ruby-identifier">method_name</span>, <span class="ruby-identifier">return_type</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">args</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">b</span>)
222
- <span class="ruby-identifier">exp</span> = <span class="ruby-identifier">expectations</span>.<span class="ruby-identifier">find</span>(<span class="ruby-identifier">method_name</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">args</span>)
223
- <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">exp</span>
224
- <span class="ruby-identifier">res</span> = <span class="ruby-identifier">instance</span>.<span class="ruby-identifier">__send__</span>(<span class="ruby-identifier">method_name</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">args</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">b</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">exp</span>.<span class="ruby-identifier">super_before?</span>
225
- <span class="ruby-identifier">res</span> = <span class="ruby-identifier">exp</span>.<span class="ruby-identifier">execute</span> <span class="ruby-operator">*</span><span class="ruby-identifier">args</span>
226
- <span class="ruby-identifier">res</span> = <span class="ruby-identifier">instance</span>.<span class="ruby-identifier">__send__</span>(<span class="ruby-identifier">method_name</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">args</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">b</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">exp</span>.<span class="ruby-identifier">super_before?</span> <span class="ruby-keyword kw">and</span> <span class="ruby-identifier">exp</span>.<span class="ruby-identifier">call_super?</span>
227
- <span class="ruby-identifier">res</span>
228
- <span class="ruby-keyword kw">else</span>
229
- <span class="ruby-keyword kw">nil</span>
230
- <span class="ruby-keyword kw">end</span>
231
- <span class="ruby-keyword kw">end</span></pre>
221
+ <span class="ruby-comment cmt"># File lib/caricature/messenger.rb, line 43</span>
222
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">internal_deliver</span>(<span class="ruby-identifier">mode</span>, <span class="ruby-identifier">method_name</span>, <span class="ruby-identifier">return_type</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">args</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">b</span>)
223
+ <span class="ruby-identifier">exp</span> = <span class="ruby-identifier">expectations</span>.<span class="ruby-identifier">find</span>(<span class="ruby-identifier">method_name</span>, <span class="ruby-identifier">mode</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">args</span>)
224
+ <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">exp</span>
225
+ <span class="ruby-identifier">res</span> = <span class="ruby-identifier">instance</span>.<span class="ruby-identifier">__send__</span>(<span class="ruby-identifier">method_name</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">args</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">b</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">exp</span>.<span class="ruby-identifier">super_before?</span>
226
+ <span class="ruby-identifier">res</span> = <span class="ruby-identifier">exp</span>.<span class="ruby-identifier">execute</span> <span class="ruby-operator">*</span><span class="ruby-identifier">args</span>
227
+ <span class="ruby-identifier">res</span> = <span class="ruby-identifier">instance</span>.<span class="ruby-identifier">__send__</span>(<span class="ruby-identifier">method_name</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">args</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">b</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">exp</span>.<span class="ruby-identifier">super_before?</span> <span class="ruby-keyword kw">and</span> <span class="ruby-identifier">exp</span>.<span class="ruby-identifier">call_super?</span>
228
+ <span class="ruby-identifier">res</span>
229
+ <span class="ruby-keyword kw">else</span>
230
+ <span class="ruby-keyword kw">nil</span>
231
+ <span class="ruby-keyword kw">end</span>
232
+ <span class="ruby-keyword kw">end</span></pre>
232
233
  </div>
233
234
 
234
235
  </div>
@@ -59,9 +59,9 @@
59
59
  <h3 class="section-header">Methods</h3>
60
60
  <ul class="link-list">
61
61
 
62
- <li><a href="#M000026">#initialize_class_members_for</a></li>
62
+ <li><a href="#M000024">#initialize_class_members_for</a></li>
63
63
 
64
- <li><a href="#M000024">#initialize_instance_members_for</a></li>
64
+ <li><a href="#M000023">#initialize_instance_members_for</a></li>
65
65
 
66
66
  </ul>
67
67
  </div>
@@ -198,7 +198,7 @@ Describes a ruby object.
198
198
 
199
199
 
200
200
  <div id="initialize-class-members-for-method" class="method-detail ">
201
- <a name="M000026"></a>
201
+ <a name="M000024"></a>
202
202
 
203
203
  <div class="method-heading">
204
204
 
@@ -233,7 +233,7 @@ Object.singleton_methods
233
233
 
234
234
 
235
235
  <div id="initialize-instance-members-for-method" class="method-detail ">
236
- <a name="M000024"></a>
236
+ <a name="M000023"></a>
237
237
 
238
238
  <div class="method-heading">
239
239
 
@@ -61,9 +61,9 @@
61
61
 
62
62
  <li><a href="#M000015">::new</a></li>
63
63
 
64
- <li><a href="#M000020">#initialize_class_members_for</a></li>
64
+ <li><a href="#M000019">#initialize_class_members_for</a></li>
65
65
 
66
- <li><a href="#M000018">#initialize_instance_members_for</a></li>
66
+ <li><a href="#M000017">#initialize_instance_members_for</a></li>
67
67
 
68
68
  </ul>
69
69
  </div>
@@ -288,7 +288,7 @@ initializes a new instance of a type descriptor
288
288
 
289
289
 
290
290
  <div id="initialize-class-members-for-method" class="method-detail ">
291
- <a name="M000020"></a>
291
+ <a name="M000019"></a>
292
292
 
293
293
  <div class="method-heading">
294
294
 
@@ -322,7 +322,7 @@ collects the class members of the provided type
322
322
 
323
323
 
324
324
  <div id="initialize-instance-members-for-method" class="method-detail ">
325
- <a name="M000018"></a>
325
+ <a name="M000017"></a>
326
326
 
327
327
  <div class="method-heading">
328
328
 
@@ -59,17 +59,17 @@
59
59
  <h3 class="section-header">Methods</h3>
60
60
  <ul class="link-list">
61
61
 
62
- <li><a href="#M000073">::new</a></li>
62
+ <li><a href="#M000084">::new</a></li>
63
63
 
64
- <li><a href="#M000077">#allow_any_arguments</a></li>
64
+ <li><a href="#M000088">#allow_any_arguments</a></li>
65
65
 
66
- <li><a href="#M000075">#any_args?</a></li>
66
+ <li><a href="#M000085">#any_args?</a></li>
67
67
 
68
- <li><a href="#M000078">#matches?</a></li>
68
+ <li><a href="#M000089">#matches?</a></li>
69
69
 
70
- <li><a href="#M000080">#successful?</a></li>
70
+ <li><a href="#M000091">#successful?</a></li>
71
71
 
72
- <li><a href="#M000076">#with</a></li>
72
+ <li><a href="#M000086">#with</a></li>
73
73
 
74
74
  </ul>
75
75
  </div>
@@ -207,12 +207,12 @@ assertion
207
207
 
208
208
 
209
209
  <div id="new-method" class="method-detail ">
210
- <a name="M000073"></a>
210
+ <a name="M000084"></a>
211
211
 
212
212
  <div class="method-heading">
213
213
 
214
214
  <span class="method-name">new</span><span
215
- class="method-args">(method_name, recorder)</span>
215
+ class="method-args">(method_name, recorder, mode=:instance)</span>
216
216
  <span class="method-click-advice">click to toggle source</span>
217
217
 
218
218
  </div>
@@ -229,8 +229,8 @@ Initializes a new instance of a <tt>Verification</tt>
229
229
  id="new-source">
230
230
  <pre>
231
231
  <span class="ruby-comment cmt"># File lib/caricature/verification.rb, line 8</span>
232
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">method_name</span>, <span class="ruby-identifier">recorder</span>)
233
- <span class="ruby-ivar">@method_name</span>, <span class="ruby-ivar">@args</span>, <span class="ruby-ivar">@any_args</span>, <span class="ruby-ivar">@recorder</span> = <span class="ruby-identifier">method_name</span>, [], <span class="ruby-keyword kw">true</span>, <span class="ruby-identifier">recorder</span>
232
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">method_name</span>, <span class="ruby-identifier">recorder</span>, <span class="ruby-identifier">mode</span>=<span class="ruby-identifier">:instance</span>)
233
+ <span class="ruby-ivar">@method_name</span>, <span class="ruby-ivar">@args</span>, <span class="ruby-ivar">@any_args</span>, <span class="ruby-ivar">@recorder</span>, <span class="ruby-ivar">@mode</span> = <span class="ruby-identifier">method_name</span>, [], <span class="ruby-keyword kw">true</span>, <span class="ruby-identifier">recorder</span>, <span class="ruby-identifier">mode</span>
234
234
  <span class="ruby-keyword kw">end</span></pre>
235
235
  </div>
236
236
 
@@ -247,7 +247,7 @@ Initializes a new instance of a <tt>Verification</tt>
247
247
 
248
248
 
249
249
  <div id="allow-any-arguments-method" class="method-detail ">
250
- <a name="M000077"></a>
250
+ <a name="M000088"></a>
251
251
 
252
252
  <div class="method-heading">
253
253
 
@@ -282,7 +282,7 @@ allow any arguments ignore the argument constraint
282
282
 
283
283
 
284
284
  <div id="any-args--method" class="method-detail ">
285
- <a name="M000075"></a>
285
+ <a name="M000085"></a>
286
286
 
287
287
  <div class="method-heading">
288
288
 
@@ -316,7 +316,7 @@ indicates whether this verification can be for any arguments
316
316
 
317
317
 
318
318
  <div id="matches--method" class="method-detail ">
319
- <a name="M000078"></a>
319
+ <a name="M000089"></a>
320
320
 
321
321
  <div class="method-heading">
322
322
 
@@ -350,7 +350,7 @@ figure out if this argument variation matches the provided args.
350
350
 
351
351
 
352
352
  <div id="successful--method" class="method-detail ">
353
- <a name="M000080"></a>
353
+ <a name="M000091"></a>
354
354
 
355
355
  <div class="method-heading">
356
356
 
@@ -374,7 +374,7 @@ indicate that this method verification is successful
374
374
  <span class="ruby-comment cmt"># File lib/caricature/verification.rb, line 36</span>
375
375
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">successful?</span>
376
376
  <span class="ruby-identifier">a</span> = <span class="ruby-identifier">any_args?</span> <span class="ruby-value">? </span>[<span class="ruby-identifier">:any</span>] <span class="ruby-operator">:</span> <span class="ruby-ivar">@args</span>
377
- <span class="ruby-ivar">@recorder</span>.<span class="ruby-identifier">was_called?</span>(<span class="ruby-ivar">@method_name</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">a</span>)
377
+ <span class="ruby-ivar">@recorder</span>.<span class="ruby-identifier">was_called?</span>(<span class="ruby-ivar">@method_name</span>, <span class="ruby-ivar">@mode</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">a</span>)
378
378
  <span class="ruby-keyword kw">end</span></pre>
379
379
  </div>
380
380
 
@@ -385,7 +385,7 @@ indicate that this method verification is successful
385
385
 
386
386
 
387
387
  <div id="with-method" class="method-detail ">
388
- <a name="M000076"></a>
388
+ <a name="M000086"></a>
389
389
 
390
390
  <div class="method-heading">
391
391
 
data/doc/Caricature.html CHANGED
@@ -52,8 +52,8 @@
52
52
  <li><a href="./lib/caricature/isolator_rb.html?TB_iframe=true&amp;height=550&amp;width=785"
53
53
  class="thickbox" title="lib/caricature/isolator.rb">lib/caricature/isolator.rb</a></li>
54
54
 
55
- <li><a href="./lib/caricature/messaging_rb.html?TB_iframe=true&amp;height=550&amp;width=785"
56
- class="thickbox" title="lib/caricature/messaging.rb">lib/caricature/messaging.rb</a></li>
55
+ <li><a href="./lib/caricature/messenger_rb.html?TB_iframe=true&amp;height=550&amp;width=785"
56
+ class="thickbox" title="lib/caricature/messenger.rb">lib/caricature/messenger.rb</a></li>
57
57
 
58
58
  <li><a href="./lib/caricature/method_call_recorder_rb.html?TB_iframe=true&amp;height=550&amp;width=785"
59
59
  class="thickbox" title="lib/caricature/method_call_recorder.rb">lib/caricature/method_call_recorder.rb</a></li>
data/doc/Class.html CHANGED
@@ -59,9 +59,9 @@
59
59
  <h3 class="section-header">Methods</h3>
60
60
  <ul class="link-list">
61
61
 
62
- <li><a href="#M000081">#demodulize</a></li>
62
+ <li><a href="#M000090">#demodulize</a></li>
63
63
 
64
- <li><a href="#M000082">#is_clr_type?</a></li>
64
+ <li><a href="#M000092">#is_clr_type?</a></li>
65
65
 
66
66
  </ul>
67
67
  </div>
@@ -195,7 +195,7 @@
195
195
 
196
196
 
197
197
  <div id="demodulize-method" class="method-detail ">
198
- <a name="M000081"></a>
198
+ <a name="M000090"></a>
199
199
 
200
200
  <div class="method-heading">
201
201
 
@@ -229,7 +229,7 @@ removes all the modules from this class name
229
229
 
230
230
 
231
231
  <div id="is-clr-type--method" class="method-detail ">
232
- <a name="M000082"></a>
232
+ <a name="M000092"></a>
233
233
 
234
234
  <div class="method-heading">
235
235