caricature 0.3.1 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +4 -0
- data/Rakefile +100 -0
- data/VERSION +1 -0
- data/caricature.gemspec +177 -0
- data/doc/Array.html +251 -0
- data/doc/Caricature/ArgumentRecording.html +366 -0
- data/doc/Caricature/ClrClassDescriptor.html +303 -0
- data/doc/Caricature/ClrClassMessenger.html +263 -0
- data/doc/Caricature/ClrInterfaceDescriptor.html +295 -0
- data/doc/Caricature/ClrInterfaceIsolator.html +365 -0
- data/doc/Caricature/ClrInterfaceMessenger.html +260 -0
- data/doc/Caricature/ClrIsolator.html +424 -0
- data/doc/Caricature/Expectation.html +549 -0
- data/doc/Caricature/ExpectationBuilder.html +308 -0
- data/doc/Caricature/ExpectationSyntax.html +438 -0
- data/doc/Caricature/Expectations.html +344 -0
- data/doc/Caricature/Interception/ClassMethods.html +246 -0
- data/doc/Caricature/Interception.html +416 -0
- data/doc/Caricature/Isolation.html +578 -0
- data/doc/Caricature/Isolator.html +519 -0
- data/doc/Caricature/MemberDescriptor.html +335 -0
- data/doc/Caricature/Messenger.html +335 -0
- data/doc/Caricature/MethodCallRecorder.html +440 -0
- data/doc/Caricature/MethodCallRecording.html +493 -0
- data/doc/Caricature/RubyIsolator.html +416 -0
- data/doc/Caricature/RubyMessenger.html +260 -0
- data/doc/Caricature/RubyObjectDescriptor.html +289 -0
- data/doc/Caricature/TypeDescriptor.html +378 -0
- data/doc/Caricature/Verification.html +443 -0
- data/doc/Caricature.html +358 -0
- data/doc/Class.html +287 -0
- data/doc/Hash.html +255 -0
- data/doc/Module.html +287 -0
- data/doc/Object.html +322 -0
- data/doc/README_markdown.html +241 -0
- data/doc/String.html +289 -0
- data/doc/System/String.html +289 -0
- data/doc/System/Type.html +289 -0
- data/doc/System.html +207 -0
- data/doc/created.rid +1 -0
- data/doc/images/brick.png +0 -0
- data/doc/images/brick_link.png +0 -0
- data/doc/images/bug.png +0 -0
- data/doc/images/bullet_black.png +0 -0
- data/doc/images/bullet_toggle_minus.png +0 -0
- data/doc/images/bullet_toggle_plus.png +0 -0
- data/doc/images/date.png +0 -0
- data/doc/images/find.png +0 -0
- data/doc/images/loadingAnimation.gif +0 -0
- data/doc/images/macFFBgHack.png +0 -0
- data/doc/images/package.png +0 -0
- data/doc/images/page_green.png +0 -0
- data/doc/images/page_white_text.png +0 -0
- data/doc/images/page_white_width.png +0 -0
- data/doc/images/plugin.png +0 -0
- data/doc/images/ruby.png +0 -0
- data/doc/images/tag_green.png +0 -0
- data/doc/images/wrench.png +0 -0
- data/doc/images/wrench_orange.png +0 -0
- data/doc/images/zoom.png +0 -0
- data/doc/index.html +312 -0
- data/doc/js/darkfish.js +116 -0
- data/doc/js/jquery.js +32 -0
- data/doc/js/quicksearch.js +114 -0
- data/doc/js/thickbox-compressed.js +10 -0
- data/doc/lib/caricature/clr/descriptor_rb.html +52 -0
- data/doc/lib/caricature/clr/isolation_rb.html +52 -0
- data/doc/lib/caricature/clr/isolator_rb.html +52 -0
- data/doc/lib/caricature/clr/messenger_rb.html +52 -0
- data/doc/lib/caricature/clr_rb.html +52 -0
- data/doc/lib/caricature/descriptor_rb.html +52 -0
- data/doc/lib/caricature/expectation_rb.html +52 -0
- data/doc/lib/caricature/isolation_rb.html +52 -0
- data/doc/lib/caricature/isolator_rb.html +52 -0
- data/doc/lib/caricature/messaging_rb.html +52 -0
- data/doc/lib/caricature/method_call_recorder_rb.html +52 -0
- data/doc/lib/caricature/verification_rb.html +52 -0
- data/doc/lib/caricature_rb.html +52 -0
- data/doc/lib/core_ext/array_rb.html +52 -0
- data/doc/lib/core_ext/class_rb.html +52 -0
- data/doc/lib/core_ext/core_ext_rb.html +52 -0
- data/doc/lib/core_ext/hash_rb.html +52 -0
- data/doc/lib/core_ext/module_rb.html +52 -0
- data/doc/lib/core_ext/object_rb.html +52 -0
- data/doc/lib/core_ext/string_rb.html +52 -0
- data/doc/lib/core_ext/system/string_rb.html +52 -0
- data/doc/lib/core_ext/system/type_rb.html +52 -0
- data/doc/rdoc.css +696 -0
- data/irb_init.rb +9 -0
- data/lib/bin/Workarounds.dll +0 -0
- data/lib/bin/Workarounds.pdb +0 -0
- data/lib/caricature/clr/descriptor.rb +55 -0
- data/lib/caricature/clr/isolation.rb +33 -0
- data/lib/caricature/clr/isolator.rb +112 -0
- data/lib/caricature/clr/messenger.rb +46 -0
- data/lib/caricature/clr.rb +6 -0
- data/lib/caricature/descriptor.rb +74 -0
- data/lib/caricature/expectation.rb +159 -0
- data/lib/caricature/isolation.rb +146 -0
- data/lib/caricature/isolator.rb +287 -0
- data/lib/caricature/messenger.rb +57 -0
- data/lib/caricature/method_call_recorder.rb +130 -0
- data/lib/caricature/verification.rb +43 -0
- data/lib/caricature.rb +11 -0
- data/lib/core_ext/array.rb +10 -0
- data/lib/core_ext/class.rb +15 -0
- data/lib/core_ext/core_ext.rb +8 -0
- data/lib/core_ext/hash.rb +13 -0
- data/lib/core_ext/module.rb +15 -0
- data/lib/core_ext/object.rb +19 -0
- data/lib/core_ext/string.rb +17 -0
- data/lib/core_ext/system/string.rb +21 -0
- data/lib/core_ext/system/type.rb +21 -0
- data/pkg/.gitignore +0 -0
- data/pkg/caricature-0.1.0.gem +0 -0
- data/spec/bacon_helper.rb +49 -3
- data/spec/bin/.gitignore +0 -0
- data/spec/core_ext_spec.rb +9 -0
- data/spec/descriptor_spec.rb +142 -0
- data/spec/expectation_spec.rb +11 -7
- data/spec/integration_spec.rb +94 -2
- data/spec/isolation_spec.rb +0 -42
- data/spec/isolator_spec.rb +72 -66
- data/spec/messaging_spec.rb +172 -0
- data/spec/method_call_spec.rb +21 -21
- data/spec/models/ClrModels.cs +185 -0
- data/spec/verification_spec.rb +1 -1
- data/workarounds/ReflectionHelper.cs +30 -0
- metadata +133 -2
@@ -0,0 +1,440 @@
|
|
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>Class: Caricature::MethodCallRecorder</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="class">
|
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/method_call_recorder_rb.html?TB_iframe=true&height=550&width=785"
|
32
|
+
class="thickbox" title="lib/caricature/method_call_recorder.rb">lib/caricature/method_call_recorder.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
|
+
<div id="parent-class-section" class="section">
|
46
|
+
<h3 class="section-header">Parent</h3>
|
47
|
+
|
48
|
+
<p class="link"><a href="../Object.html">Object</a></p>
|
49
|
+
|
50
|
+
</div>
|
51
|
+
|
52
|
+
|
53
|
+
<!-- Namespace Contents -->
|
54
|
+
|
55
|
+
|
56
|
+
<!-- Method Quickref -->
|
57
|
+
|
58
|
+
<div id="method-list-section" class="section">
|
59
|
+
<h3 class="section-header">Methods</h3>
|
60
|
+
<ul class="link-list">
|
61
|
+
|
62
|
+
<li><a href="#M000069">::new</a></li>
|
63
|
+
|
64
|
+
<li><a href="#M000072">#[]</a></li>
|
65
|
+
|
66
|
+
<li><a href="#M000070">#record_call</a></li>
|
67
|
+
|
68
|
+
<li><a href="#M000074">#size</a></li>
|
69
|
+
|
70
|
+
<li><a href="#M000071">#was_called?</a></li>
|
71
|
+
|
72
|
+
</ul>
|
73
|
+
</div>
|
74
|
+
|
75
|
+
|
76
|
+
<!-- Included Modules -->
|
77
|
+
|
78
|
+
</div>
|
79
|
+
|
80
|
+
<div id="project-metadata">
|
81
|
+
|
82
|
+
|
83
|
+
<div id="fileindex-section" class="section project-section">
|
84
|
+
<h3 class="section-header">Files</h3>
|
85
|
+
<ul>
|
86
|
+
|
87
|
+
<li class="file"><a href="../README_markdown.html">README.markdown</a></li>
|
88
|
+
|
89
|
+
</ul>
|
90
|
+
</div>
|
91
|
+
|
92
|
+
|
93
|
+
<div id="classindex-section" class="section project-section">
|
94
|
+
<h3 class="section-header">Class Index
|
95
|
+
<span class="search-toggle"><img src="../images/find.png"
|
96
|
+
height="16" width="16" alt="[+]"
|
97
|
+
title="show/hide quicksearch" /></span></h3>
|
98
|
+
<form action="#" method="get" accept-charset="utf-8" class="initially-hidden">
|
99
|
+
<fieldset>
|
100
|
+
<legend>Quicksearch</legend>
|
101
|
+
<input type="text" name="quicksearch" value=""
|
102
|
+
class="quicksearch-field" />
|
103
|
+
</fieldset>
|
104
|
+
</form>
|
105
|
+
|
106
|
+
<ul class="link-list">
|
107
|
+
|
108
|
+
<li><a href="../Caricature.html">Caricature</a></li>
|
109
|
+
|
110
|
+
<li><a href="../Caricature/ArgumentRecording.html">Caricature::ArgumentRecording</a></li>
|
111
|
+
|
112
|
+
<li><a href="../Caricature/ClrClassDescriptor.html">Caricature::ClrClassDescriptor</a></li>
|
113
|
+
|
114
|
+
<li><a href="../Caricature/ClrClassMessenger.html">Caricature::ClrClassMessenger</a></li>
|
115
|
+
|
116
|
+
<li><a href="../Caricature/ClrInterfaceDescriptor.html">Caricature::ClrInterfaceDescriptor</a></li>
|
117
|
+
|
118
|
+
<li><a href="../Caricature/ClrInterfaceIsolator.html">Caricature::ClrInterfaceIsolator</a></li>
|
119
|
+
|
120
|
+
<li><a href="../Caricature/ClrInterfaceMessenger.html">Caricature::ClrInterfaceMessenger</a></li>
|
121
|
+
|
122
|
+
<li><a href="../Caricature/ClrIsolator.html">Caricature::ClrIsolator</a></li>
|
123
|
+
|
124
|
+
<li><a href="../Caricature/Expectation.html">Caricature::Expectation</a></li>
|
125
|
+
|
126
|
+
<li><a href="../Caricature/ExpectationBuilder.html">Caricature::ExpectationBuilder</a></li>
|
127
|
+
|
128
|
+
<li><a href="../Caricature/ExpectationSyntax.html">Caricature::ExpectationSyntax</a></li>
|
129
|
+
|
130
|
+
<li><a href="../Caricature/Expectations.html">Caricature::Expectations</a></li>
|
131
|
+
|
132
|
+
<li><a href="../Caricature/Interception.html">Caricature::Interception</a></li>
|
133
|
+
|
134
|
+
<li><a href="../Caricature/Interception/ClassMethods.html">Caricature::Interception::ClassMethods</a></li>
|
135
|
+
|
136
|
+
<li><a href="../Caricature/Isolation.html">Caricature::Isolation</a></li>
|
137
|
+
|
138
|
+
<li><a href="../Caricature/Isolator.html">Caricature::Isolator</a></li>
|
139
|
+
|
140
|
+
<li><a href="../Caricature/MemberDescriptor.html">Caricature::MemberDescriptor</a></li>
|
141
|
+
|
142
|
+
<li><a href="../Caricature/Messenger.html">Caricature::Messenger</a></li>
|
143
|
+
|
144
|
+
<li><a href="../Caricature/MethodCallRecorder.html">Caricature::MethodCallRecorder</a></li>
|
145
|
+
|
146
|
+
<li><a href="../Caricature/MethodCallRecording.html">Caricature::MethodCallRecording</a></li>
|
147
|
+
|
148
|
+
<li><a href="../Caricature/RubyIsolator.html">Caricature::RubyIsolator</a></li>
|
149
|
+
|
150
|
+
<li><a href="../Caricature/RubyMessenger.html">Caricature::RubyMessenger</a></li>
|
151
|
+
|
152
|
+
<li><a href="../Caricature/RubyObjectDescriptor.html">Caricature::RubyObjectDescriptor</a></li>
|
153
|
+
|
154
|
+
<li><a href="../Caricature/TypeDescriptor.html">Caricature::TypeDescriptor</a></li>
|
155
|
+
|
156
|
+
<li><a href="../Caricature/Verification.html">Caricature::Verification</a></li>
|
157
|
+
|
158
|
+
<li><a href="../System.html">System</a></li>
|
159
|
+
|
160
|
+
<li><a href="../System/String.html">System::String</a></li>
|
161
|
+
|
162
|
+
<li><a href="../System/Type.html">System::Type</a></li>
|
163
|
+
|
164
|
+
<li><a href="../Array.html">Array</a></li>
|
165
|
+
|
166
|
+
<li><a href="../Class.html">Class</a></li>
|
167
|
+
|
168
|
+
<li><a href="../Hash.html">Hash</a></li>
|
169
|
+
|
170
|
+
<li><a href="../Module.html">Module</a></li>
|
171
|
+
|
172
|
+
<li><a href="../Object.html">Object</a></li>
|
173
|
+
|
174
|
+
<li><a href="../String.html">String</a></li>
|
175
|
+
|
176
|
+
</ul>
|
177
|
+
<div id="no-class-search-results" style="display: none;">No matching classes.</div>
|
178
|
+
</div>
|
179
|
+
|
180
|
+
|
181
|
+
</div>
|
182
|
+
</div>
|
183
|
+
|
184
|
+
<div id="documentation">
|
185
|
+
<h1 class="class">Caricature::MethodCallRecorder</h1>
|
186
|
+
|
187
|
+
<div id="description">
|
188
|
+
<p>
|
189
|
+
The recorder that will collect method calls and provides an interface for
|
190
|
+
finding those recordings
|
191
|
+
</p>
|
192
|
+
|
193
|
+
</div>
|
194
|
+
|
195
|
+
<!-- Constants -->
|
196
|
+
|
197
|
+
|
198
|
+
<!-- Attributes -->
|
199
|
+
|
200
|
+
<div id="attribute-method-details" class="method-section section">
|
201
|
+
<h3 class="section-header">Attributes</h3>
|
202
|
+
|
203
|
+
|
204
|
+
<div id="method-calls-attribute-method" class="method-detail">
|
205
|
+
<a name="method_calls"></a>
|
206
|
+
|
207
|
+
<div class="method-heading attribute-method-heading">
|
208
|
+
<span class="method-name">method_calls</span><span
|
209
|
+
class="attribute-access-type">[R]</span>
|
210
|
+
</div>
|
211
|
+
|
212
|
+
<div class="method-description">
|
213
|
+
|
214
|
+
<p>
|
215
|
+
gets the collection of method calls. This is a hash with the method name as
|
216
|
+
key
|
217
|
+
</p>
|
218
|
+
|
219
|
+
</div>
|
220
|
+
</div>
|
221
|
+
|
222
|
+
</div>
|
223
|
+
|
224
|
+
|
225
|
+
<!-- Methods -->
|
226
|
+
|
227
|
+
<div id="public-class-method-details" class="method-section section">
|
228
|
+
<h3 class="section-header">Public Class Methods</h3>
|
229
|
+
|
230
|
+
|
231
|
+
<div id="new-method" class="method-detail ">
|
232
|
+
<a name="M000069"></a>
|
233
|
+
|
234
|
+
<div class="method-heading">
|
235
|
+
|
236
|
+
<span class="method-name">new</span><span
|
237
|
+
class="method-args">()</span>
|
238
|
+
<span class="method-click-advice">click to toggle source</span>
|
239
|
+
|
240
|
+
</div>
|
241
|
+
|
242
|
+
<div class="method-description">
|
243
|
+
|
244
|
+
<p>
|
245
|
+
Initializes a new instance of a method call recorder every time a method
|
246
|
+
gets called in an isolated object this gets stored in the method call
|
247
|
+
recorder
|
248
|
+
</p>
|
249
|
+
|
250
|
+
|
251
|
+
|
252
|
+
<div class="method-source-code"
|
253
|
+
id="new-source">
|
254
|
+
<pre>
|
255
|
+
<span class="ruby-comment cmt"># File lib/caricature/method_call_recorder.rb, line 94</span>
|
256
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>
|
257
|
+
<span class="ruby-ivar">@method_calls</span> = {}
|
258
|
+
<span class="ruby-keyword kw">end</span></pre>
|
259
|
+
</div>
|
260
|
+
|
261
|
+
</div>
|
262
|
+
|
263
|
+
|
264
|
+
</div>
|
265
|
+
|
266
|
+
|
267
|
+
</div>
|
268
|
+
|
269
|
+
<div id="public-instance-method-details" class="method-section section">
|
270
|
+
<h3 class="section-header">Public Instance Methods</h3>
|
271
|
+
|
272
|
+
|
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
|
+
<div id="record-call-method" class="method-detail ">
|
308
|
+
<a name="M000070"></a>
|
309
|
+
|
310
|
+
<div class="method-heading">
|
311
|
+
|
312
|
+
<span class="method-name">record_call</span><span
|
313
|
+
class="method-args">(method_name, *args, &block)</span>
|
314
|
+
<span class="method-click-advice">click to toggle source</span>
|
315
|
+
|
316
|
+
</div>
|
317
|
+
|
318
|
+
<div class="method-description">
|
319
|
+
|
320
|
+
<p>
|
321
|
+
records a method call or increments the count of how many times this method
|
322
|
+
was called.
|
323
|
+
</p>
|
324
|
+
|
325
|
+
|
326
|
+
|
327
|
+
<div class="method-source-code"
|
328
|
+
id="record-call-source">
|
329
|
+
<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">&</span><span class="ruby-identifier">block</span>)
|
332
|
+
<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>]
|
335
|
+
<span class="ruby-identifier">mc</span>.<span class="ruby-identifier">count</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
|
336
|
+
<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
|
+
<span class="ruby-keyword kw">end</span></pre>
|
338
|
+
</div>
|
339
|
+
|
340
|
+
</div>
|
341
|
+
|
342
|
+
|
343
|
+
</div>
|
344
|
+
|
345
|
+
|
346
|
+
<div id="size-method" class="method-detail ">
|
347
|
+
<a name="M000074"></a>
|
348
|
+
|
349
|
+
<div class="method-heading">
|
350
|
+
|
351
|
+
<span class="method-name">size</span><span
|
352
|
+
class="method-args">()</span>
|
353
|
+
<span class="method-click-advice">click to toggle source</span>
|
354
|
+
|
355
|
+
</div>
|
356
|
+
|
357
|
+
<div class="method-description">
|
358
|
+
|
359
|
+
<p>
|
360
|
+
returns the number of different methods that has been recorderd
|
361
|
+
</p>
|
362
|
+
|
363
|
+
|
364
|
+
|
365
|
+
<div class="method-source-code"
|
366
|
+
id="size-source">
|
367
|
+
<pre>
|
368
|
+
<span class="ruby-comment cmt"># File lib/caricature/method_call_recorder.rb, line 123</span>
|
369
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">size</span>
|
370
|
+
<span class="ruby-ivar">@method_calls</span>.<span class="ruby-identifier">size</span>
|
371
|
+
<span class="ruby-keyword kw">end</span></pre>
|
372
|
+
</div>
|
373
|
+
|
374
|
+
</div>
|
375
|
+
|
376
|
+
|
377
|
+
</div>
|
378
|
+
|
379
|
+
|
380
|
+
<div id="was-called--method" class="method-detail ">
|
381
|
+
<a name="M000071"></a>
|
382
|
+
|
383
|
+
<div class="method-heading">
|
384
|
+
|
385
|
+
<span class="method-name">was_called?</span><span
|
386
|
+
class="method-args">(method_name, *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
|
+
returns whether the method was actually called with the specified
|
395
|
+
constraints
|
396
|
+
</p>
|
397
|
+
|
398
|
+
|
399
|
+
|
400
|
+
<div class="method-source-code"
|
401
|
+
id="was-called--source">
|
402
|
+
<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>]
|
406
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">mc</span>
|
407
|
+
<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
|
+
<span class="ruby-keyword kw">else</span>
|
409
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-operator">!</span><span class="ruby-operator">!</span><span class="ruby-identifier">mc</span>
|
410
|
+
<span class="ruby-keyword kw">end</span>
|
411
|
+
<span class="ruby-keyword kw">end</span></pre>
|
412
|
+
</div>
|
413
|
+
|
414
|
+
</div>
|
415
|
+
|
416
|
+
|
417
|
+
</div>
|
418
|
+
|
419
|
+
|
420
|
+
</div>
|
421
|
+
|
422
|
+
|
423
|
+
</div>
|
424
|
+
|
425
|
+
|
426
|
+
<div id="rdoc-debugging-section-dump" class="debugging-section">
|
427
|
+
|
428
|
+
<p>Disabled; run with --debug to generate this.</p>
|
429
|
+
|
430
|
+
</div>
|
431
|
+
|
432
|
+
<div id="validator-badges">
|
433
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
434
|
+
<p><small>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish
|
435
|
+
Rdoc Generator</a> 1.1.6</small>.</p>
|
436
|
+
</div>
|
437
|
+
|
438
|
+
</body>
|
439
|
+
</html>
|
440
|
+
|