caricature 0.3.1 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (129) hide show
  1. data/.gitignore +4 -0
  2. data/Rakefile +100 -0
  3. data/VERSION +1 -0
  4. data/caricature.gemspec +177 -0
  5. data/doc/Array.html +251 -0
  6. data/doc/Caricature/ArgumentRecording.html +366 -0
  7. data/doc/Caricature/ClrClassDescriptor.html +303 -0
  8. data/doc/Caricature/ClrClassMessenger.html +263 -0
  9. data/doc/Caricature/ClrInterfaceDescriptor.html +295 -0
  10. data/doc/Caricature/ClrInterfaceIsolator.html +365 -0
  11. data/doc/Caricature/ClrInterfaceMessenger.html +260 -0
  12. data/doc/Caricature/ClrIsolator.html +424 -0
  13. data/doc/Caricature/Expectation.html +549 -0
  14. data/doc/Caricature/ExpectationBuilder.html +308 -0
  15. data/doc/Caricature/ExpectationSyntax.html +438 -0
  16. data/doc/Caricature/Expectations.html +344 -0
  17. data/doc/Caricature/Interception/ClassMethods.html +246 -0
  18. data/doc/Caricature/Interception.html +416 -0
  19. data/doc/Caricature/Isolation.html +578 -0
  20. data/doc/Caricature/Isolator.html +519 -0
  21. data/doc/Caricature/MemberDescriptor.html +335 -0
  22. data/doc/Caricature/Messenger.html +335 -0
  23. data/doc/Caricature/MethodCallRecorder.html +440 -0
  24. data/doc/Caricature/MethodCallRecording.html +493 -0
  25. data/doc/Caricature/RubyIsolator.html +416 -0
  26. data/doc/Caricature/RubyMessenger.html +260 -0
  27. data/doc/Caricature/RubyObjectDescriptor.html +289 -0
  28. data/doc/Caricature/TypeDescriptor.html +378 -0
  29. data/doc/Caricature/Verification.html +443 -0
  30. data/doc/Caricature.html +358 -0
  31. data/doc/Class.html +287 -0
  32. data/doc/Hash.html +255 -0
  33. data/doc/Module.html +287 -0
  34. data/doc/Object.html +322 -0
  35. data/doc/README_markdown.html +241 -0
  36. data/doc/String.html +289 -0
  37. data/doc/System/String.html +289 -0
  38. data/doc/System/Type.html +289 -0
  39. data/doc/System.html +207 -0
  40. data/doc/created.rid +1 -0
  41. data/doc/images/brick.png +0 -0
  42. data/doc/images/brick_link.png +0 -0
  43. data/doc/images/bug.png +0 -0
  44. data/doc/images/bullet_black.png +0 -0
  45. data/doc/images/bullet_toggle_minus.png +0 -0
  46. data/doc/images/bullet_toggle_plus.png +0 -0
  47. data/doc/images/date.png +0 -0
  48. data/doc/images/find.png +0 -0
  49. data/doc/images/loadingAnimation.gif +0 -0
  50. data/doc/images/macFFBgHack.png +0 -0
  51. data/doc/images/package.png +0 -0
  52. data/doc/images/page_green.png +0 -0
  53. data/doc/images/page_white_text.png +0 -0
  54. data/doc/images/page_white_width.png +0 -0
  55. data/doc/images/plugin.png +0 -0
  56. data/doc/images/ruby.png +0 -0
  57. data/doc/images/tag_green.png +0 -0
  58. data/doc/images/wrench.png +0 -0
  59. data/doc/images/wrench_orange.png +0 -0
  60. data/doc/images/zoom.png +0 -0
  61. data/doc/index.html +312 -0
  62. data/doc/js/darkfish.js +116 -0
  63. data/doc/js/jquery.js +32 -0
  64. data/doc/js/quicksearch.js +114 -0
  65. data/doc/js/thickbox-compressed.js +10 -0
  66. data/doc/lib/caricature/clr/descriptor_rb.html +52 -0
  67. data/doc/lib/caricature/clr/isolation_rb.html +52 -0
  68. data/doc/lib/caricature/clr/isolator_rb.html +52 -0
  69. data/doc/lib/caricature/clr/messenger_rb.html +52 -0
  70. data/doc/lib/caricature/clr_rb.html +52 -0
  71. data/doc/lib/caricature/descriptor_rb.html +52 -0
  72. data/doc/lib/caricature/expectation_rb.html +52 -0
  73. data/doc/lib/caricature/isolation_rb.html +52 -0
  74. data/doc/lib/caricature/isolator_rb.html +52 -0
  75. data/doc/lib/caricature/messaging_rb.html +52 -0
  76. data/doc/lib/caricature/method_call_recorder_rb.html +52 -0
  77. data/doc/lib/caricature/verification_rb.html +52 -0
  78. data/doc/lib/caricature_rb.html +52 -0
  79. data/doc/lib/core_ext/array_rb.html +52 -0
  80. data/doc/lib/core_ext/class_rb.html +52 -0
  81. data/doc/lib/core_ext/core_ext_rb.html +52 -0
  82. data/doc/lib/core_ext/hash_rb.html +52 -0
  83. data/doc/lib/core_ext/module_rb.html +52 -0
  84. data/doc/lib/core_ext/object_rb.html +52 -0
  85. data/doc/lib/core_ext/string_rb.html +52 -0
  86. data/doc/lib/core_ext/system/string_rb.html +52 -0
  87. data/doc/lib/core_ext/system/type_rb.html +52 -0
  88. data/doc/rdoc.css +696 -0
  89. data/irb_init.rb +9 -0
  90. data/lib/bin/Workarounds.dll +0 -0
  91. data/lib/bin/Workarounds.pdb +0 -0
  92. data/lib/caricature/clr/descriptor.rb +55 -0
  93. data/lib/caricature/clr/isolation.rb +33 -0
  94. data/lib/caricature/clr/isolator.rb +112 -0
  95. data/lib/caricature/clr/messenger.rb +46 -0
  96. data/lib/caricature/clr.rb +6 -0
  97. data/lib/caricature/descriptor.rb +74 -0
  98. data/lib/caricature/expectation.rb +159 -0
  99. data/lib/caricature/isolation.rb +146 -0
  100. data/lib/caricature/isolator.rb +287 -0
  101. data/lib/caricature/messenger.rb +57 -0
  102. data/lib/caricature/method_call_recorder.rb +130 -0
  103. data/lib/caricature/verification.rb +43 -0
  104. data/lib/caricature.rb +11 -0
  105. data/lib/core_ext/array.rb +10 -0
  106. data/lib/core_ext/class.rb +15 -0
  107. data/lib/core_ext/core_ext.rb +8 -0
  108. data/lib/core_ext/hash.rb +13 -0
  109. data/lib/core_ext/module.rb +15 -0
  110. data/lib/core_ext/object.rb +19 -0
  111. data/lib/core_ext/string.rb +17 -0
  112. data/lib/core_ext/system/string.rb +21 -0
  113. data/lib/core_ext/system/type.rb +21 -0
  114. data/pkg/.gitignore +0 -0
  115. data/pkg/caricature-0.1.0.gem +0 -0
  116. data/spec/bacon_helper.rb +49 -3
  117. data/spec/bin/.gitignore +0 -0
  118. data/spec/core_ext_spec.rb +9 -0
  119. data/spec/descriptor_spec.rb +142 -0
  120. data/spec/expectation_spec.rb +11 -7
  121. data/spec/integration_spec.rb +94 -2
  122. data/spec/isolation_spec.rb +0 -42
  123. data/spec/isolator_spec.rb +72 -66
  124. data/spec/messaging_spec.rb +172 -0
  125. data/spec/method_call_spec.rb +21 -21
  126. data/spec/models/ClrModels.cs +185 -0
  127. data/spec/verification_spec.rb +1 -1
  128. data/workarounds/ReflectionHelper.cs +30 -0
  129. metadata +133 -2
@@ -0,0 +1,438 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
3
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
4
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
5
+ <head>
6
+ <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
7
+
8
+ <title>Module: Caricature::ExpectationSyntax</title>
9
+
10
+ <link rel="stylesheet" href="../rdoc.css" type="text/css" media="screen" />
11
+
12
+ <script src="../js/jquery.js" type="text/javascript"
13
+ charset="utf-8"></script>
14
+ <script src="../js/thickbox-compressed.js" type="text/javascript"
15
+ charset="utf-8"></script>
16
+ <script src="../js/quicksearch.js" type="text/javascript"
17
+ charset="utf-8"></script>
18
+ <script src="../js/darkfish.js" type="text/javascript"
19
+ charset="utf-8"></script>
20
+
21
+ </head>
22
+ <body class="module">
23
+
24
+ <div id="metadata">
25
+ <div id="file-metadata">
26
+ <div id="file-list-section" class="section">
27
+ <h3 class="section-header">In Files</h3>
28
+ <div class="section-body">
29
+ <ul>
30
+
31
+ <li><a href="../lib/caricature/expectation_rb.html?TB_iframe=true&amp;height=550&amp;width=785"
32
+ class="thickbox" title="lib/caricature/expectation.rb">lib/caricature/expectation.rb</a></li>
33
+
34
+ </ul>
35
+ </div>
36
+ </div>
37
+
38
+
39
+ </div>
40
+
41
+ <div id="class-metadata">
42
+
43
+ <!-- Parent Class -->
44
+
45
+
46
+ <!-- Namespace Contents -->
47
+
48
+
49
+ <!-- Method Quickref -->
50
+
51
+ <div id="method-list-section" class="section">
52
+ <h3 class="section-header">Methods</h3>
53
+ <ul class="link-list">
54
+
55
+ <li><a href="#M000030">#any_args?</a></li>
56
+
57
+ <li><a href="#M000027">#raise</a></li>
58
+
59
+ <li><a href="#M000025">#return</a></li>
60
+
61
+ <li><a href="#M000029">#super_after</a></li>
62
+
63
+ <li><a href="#M000028">#super_before</a></li>
64
+
65
+ <li><a href="#M000023">#with</a></li>
66
+
67
+ </ul>
68
+ </div>
69
+
70
+
71
+ <!-- Included Modules -->
72
+
73
+ </div>
74
+
75
+ <div id="project-metadata">
76
+
77
+
78
+ <div id="fileindex-section" class="section project-section">
79
+ <h3 class="section-header">Files</h3>
80
+ <ul>
81
+
82
+ <li class="file"><a href="../README_markdown.html">README.markdown</a></li>
83
+
84
+ </ul>
85
+ </div>
86
+
87
+
88
+ <div id="classindex-section" class="section project-section">
89
+ <h3 class="section-header">Class Index
90
+ <span class="search-toggle"><img src="../images/find.png"
91
+ height="16" width="16" alt="[+]"
92
+ title="show/hide quicksearch" /></span></h3>
93
+ <form action="#" method="get" accept-charset="utf-8" class="initially-hidden">
94
+ <fieldset>
95
+ <legend>Quicksearch</legend>
96
+ <input type="text" name="quicksearch" value=""
97
+ class="quicksearch-field" />
98
+ </fieldset>
99
+ </form>
100
+
101
+ <ul class="link-list">
102
+
103
+ <li><a href="../Caricature.html">Caricature</a></li>
104
+
105
+ <li><a href="../Caricature/ArgumentRecording.html">Caricature::ArgumentRecording</a></li>
106
+
107
+ <li><a href="../Caricature/ClrClassDescriptor.html">Caricature::ClrClassDescriptor</a></li>
108
+
109
+ <li><a href="../Caricature/ClrClassMessenger.html">Caricature::ClrClassMessenger</a></li>
110
+
111
+ <li><a href="../Caricature/ClrInterfaceDescriptor.html">Caricature::ClrInterfaceDescriptor</a></li>
112
+
113
+ <li><a href="../Caricature/ClrInterfaceIsolator.html">Caricature::ClrInterfaceIsolator</a></li>
114
+
115
+ <li><a href="../Caricature/ClrInterfaceMessenger.html">Caricature::ClrInterfaceMessenger</a></li>
116
+
117
+ <li><a href="../Caricature/ClrIsolator.html">Caricature::ClrIsolator</a></li>
118
+
119
+ <li><a href="../Caricature/Expectation.html">Caricature::Expectation</a></li>
120
+
121
+ <li><a href="../Caricature/ExpectationBuilder.html">Caricature::ExpectationBuilder</a></li>
122
+
123
+ <li><a href="../Caricature/ExpectationSyntax.html">Caricature::ExpectationSyntax</a></li>
124
+
125
+ <li><a href="../Caricature/Expectations.html">Caricature::Expectations</a></li>
126
+
127
+ <li><a href="../Caricature/Interception.html">Caricature::Interception</a></li>
128
+
129
+ <li><a href="../Caricature/Interception/ClassMethods.html">Caricature::Interception::ClassMethods</a></li>
130
+
131
+ <li><a href="../Caricature/Isolation.html">Caricature::Isolation</a></li>
132
+
133
+ <li><a href="../Caricature/Isolator.html">Caricature::Isolator</a></li>
134
+
135
+ <li><a href="../Caricature/MemberDescriptor.html">Caricature::MemberDescriptor</a></li>
136
+
137
+ <li><a href="../Caricature/Messenger.html">Caricature::Messenger</a></li>
138
+
139
+ <li><a href="../Caricature/MethodCallRecorder.html">Caricature::MethodCallRecorder</a></li>
140
+
141
+ <li><a href="../Caricature/MethodCallRecording.html">Caricature::MethodCallRecording</a></li>
142
+
143
+ <li><a href="../Caricature/RubyIsolator.html">Caricature::RubyIsolator</a></li>
144
+
145
+ <li><a href="../Caricature/RubyMessenger.html">Caricature::RubyMessenger</a></li>
146
+
147
+ <li><a href="../Caricature/RubyObjectDescriptor.html">Caricature::RubyObjectDescriptor</a></li>
148
+
149
+ <li><a href="../Caricature/TypeDescriptor.html">Caricature::TypeDescriptor</a></li>
150
+
151
+ <li><a href="../Caricature/Verification.html">Caricature::Verification</a></li>
152
+
153
+ <li><a href="../System.html">System</a></li>
154
+
155
+ <li><a href="../System/String.html">System::String</a></li>
156
+
157
+ <li><a href="../System/Type.html">System::Type</a></li>
158
+
159
+ <li><a href="../Array.html">Array</a></li>
160
+
161
+ <li><a href="../Class.html">Class</a></li>
162
+
163
+ <li><a href="../Hash.html">Hash</a></li>
164
+
165
+ <li><a href="../Module.html">Module</a></li>
166
+
167
+ <li><a href="../Object.html">Object</a></li>
168
+
169
+ <li><a href="../String.html">String</a></li>
170
+
171
+ </ul>
172
+ <div id="no-class-search-results" style="display: none;">No matching classes.</div>
173
+ </div>
174
+
175
+
176
+ </div>
177
+ </div>
178
+
179
+ <div id="documentation">
180
+ <h1 class="module">Caricature::ExpectationSyntax</h1>
181
+
182
+ <div id="description">
183
+ <p>
184
+ contains the syntax for building up an expectation This is shared between
185
+ the <tt>ExpecationBuilder</tt> and the <tt>Expectation</tt>
186
+ </p>
187
+
188
+ </div>
189
+
190
+ <!-- Constants -->
191
+
192
+
193
+ <!-- Attributes -->
194
+
195
+
196
+ <!-- Methods -->
197
+
198
+ <div id="public-instance-method-details" class="method-section section">
199
+ <h3 class="section-header">Public Instance Methods</h3>
200
+
201
+
202
+ <div id="any-args--method" class="method-detail ">
203
+ <a name="M000030"></a>
204
+
205
+ <div class="method-heading">
206
+
207
+ <span class="method-name">any_args?</span><span
208
+ class="method-args">()</span>
209
+ <span class="method-click-advice">click to toggle source</span>
210
+
211
+ </div>
212
+
213
+ <div class="method-description">
214
+
215
+ <p>
216
+ indicates whether this expectation should match with any arguments or only
217
+ for the specified arguments
218
+ </p>
219
+
220
+
221
+
222
+ <div class="method-source-code"
223
+ id="any-args--source">
224
+ <pre>
225
+ <span class="ruby-comment cmt"># File lib/caricature/expectation.rb, line 71</span>
226
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">any_args?</span>
227
+ <span class="ruby-ivar">@any_args</span>
228
+ <span class="ruby-keyword kw">end</span></pre>
229
+ </div>
230
+
231
+ </div>
232
+
233
+
234
+ </div>
235
+
236
+
237
+ <div id="raise-method" class="method-detail ">
238
+ <a name="M000027"></a>
239
+
240
+ <div class="method-heading">
241
+
242
+ <span class="method-name">raise</span><span
243
+ class="method-args">(*args)</span>
244
+ <span class="method-click-advice">click to toggle source</span>
245
+
246
+ </div>
247
+
248
+ <div class="method-description">
249
+
250
+ <p>
251
+ tell the expectation it needs to raise an error with the specified
252
+ arguments
253
+ </p>
254
+
255
+
256
+
257
+ <div class="method-source-code"
258
+ id="raise-source">
259
+ <pre>
260
+ <span class="ruby-comment cmt"># File lib/caricature/expectation.rb, line 54</span>
261
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">raise</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>)
262
+ <span class="ruby-ivar">@error_args</span> = <span class="ruby-identifier">args</span>
263
+ <span class="ruby-keyword kw">self</span>
264
+ <span class="ruby-keyword kw">end</span></pre>
265
+ </div>
266
+
267
+ </div>
268
+
269
+
270
+ </div>
271
+
272
+
273
+ <div id="return-method" class="method-detail ">
274
+ <a name="M000025"></a>
275
+
276
+ <div class="method-heading">
277
+
278
+ <span class="method-name">return</span><span
279
+ class="method-args">(value=nil)</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
+ tell the expectation it nees to return this value or the value returned by
288
+ the block you provide to this method.
289
+ </p>
290
+
291
+
292
+
293
+ <div class="method-source-code"
294
+ id="return-source">
295
+ <pre>
296
+ <span class="ruby-comment cmt"># File lib/caricature/expectation.rb, line 47</span>
297
+ <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">return</span>(<span class="ruby-identifier">value</span>=<span class="ruby-keyword kw">nil</span>)
298
+ <span class="ruby-ivar">@return_value</span> = <span class="ruby-identifier">value</span>
299
+ <span class="ruby-ivar">@return_value</span> <span class="ruby-operator">||=</span> <span class="ruby-keyword kw">yield</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">block_given?</span>
300
+ <span class="ruby-keyword kw">self</span>
301
+ <span class="ruby-keyword kw">end</span></pre>
302
+ </div>
303
+
304
+ </div>
305
+
306
+
307
+ </div>
308
+
309
+
310
+ <div id="super-after-method" class="method-detail ">
311
+ <a name="M000029"></a>
312
+
313
+ <div class="method-heading">
314
+
315
+ <span class="method-name">super_after</span><span
316
+ class="method-args">()</span>
317
+ <span class="method-click-advice">click to toggle source</span>
318
+
319
+ </div>
320
+
321
+ <div class="method-description">
322
+
323
+ <p>
324
+ tell the expectation it needs to call the super after the expecation
325
+ execution
326
+ </p>
327
+
328
+
329
+
330
+ <div class="method-source-code"
331
+ id="super-after-source">
332
+ <pre>
333
+ <span class="ruby-comment cmt"># File lib/caricature/expectation.rb, line 65</span>
334
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">super_after</span>
335
+ <span class="ruby-ivar">@super</span> = <span class="ruby-identifier">:after</span>
336
+ <span class="ruby-keyword kw">end</span></pre>
337
+ </div>
338
+
339
+ </div>
340
+
341
+
342
+ </div>
343
+
344
+
345
+ <div id="super-before-method" class="method-detail ">
346
+ <a name="M000028"></a>
347
+
348
+ <div class="method-heading">
349
+
350
+ <span class="method-name">super_before</span><span
351
+ class="method-args">()</span>
352
+ <span class="method-click-advice">click to toggle source</span>
353
+
354
+ </div>
355
+
356
+ <div class="method-description">
357
+
358
+ <p>
359
+ tell the expecation it needs to call the super before the expectation
360
+ exectution
361
+ </p>
362
+
363
+
364
+
365
+ <div class="method-source-code"
366
+ id="super-before-source">
367
+ <pre>
368
+ <span class="ruby-comment cmt"># File lib/caricature/expectation.rb, line 60</span>
369
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">super_before</span>
370
+ <span class="ruby-ivar">@super</span> = <span class="ruby-identifier">:before</span>
371
+ <span class="ruby-keyword kw">end</span></pre>
372
+ </div>
373
+
374
+ </div>
375
+
376
+
377
+ </div>
378
+
379
+
380
+ <div id="with-method" class="method-detail ">
381
+ <a name="M000023"></a>
382
+
383
+ <div class="method-heading">
384
+
385
+ <span class="method-name">with</span><span
386
+ class="method-args">(*args)</span>
387
+ <span class="method-click-advice">click to toggle source</span>
388
+
389
+ </div>
390
+
391
+ <div class="method-description">
392
+
393
+ <p>
394
+ tell the expection which arguments it needs to respond to there is a magic
395
+ argument here <tt>any</tt> which configures the expectation to respond to
396
+ any arguments
397
+ </p>
398
+
399
+
400
+
401
+ <div class="method-source-code"
402
+ id="with-source">
403
+ <pre>
404
+ <span class="ruby-comment cmt"># File lib/caricature/expectation.rb, line 39</span>
405
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">with</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>)
406
+ <span class="ruby-ivar">@any_args</span> = <span class="ruby-keyword kw">false</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">args</span>.<span class="ruby-identifier">first</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">:any</span>
407
+ <span class="ruby-ivar">@args</span> = <span class="ruby-identifier">args</span>
408
+ <span class="ruby-keyword kw">self</span>
409
+ <span class="ruby-keyword kw">end</span></pre>
410
+ </div>
411
+
412
+ </div>
413
+
414
+
415
+ </div>
416
+
417
+
418
+ </div>
419
+
420
+
421
+ </div>
422
+
423
+
424
+ <div id="rdoc-debugging-section-dump" class="debugging-section">
425
+
426
+ <p>Disabled; run with --debug to generate this.</p>
427
+
428
+ </div>
429
+
430
+ <div id="validator-badges">
431
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
432
+ <p><small>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish
433
+ Rdoc Generator</a> 1.1.6</small>.</p>
434
+ </div>
435
+
436
+ </body>
437
+ </html>
438
+