caricature 0.6.3 → 0.7.0

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