caricature 0.6.3 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +98 -0
- data/Rakefile +250 -47
- data/caricature.gemspec +79 -190
- data/lib/caricature/clr/descriptor.rb +14 -4
- data/lib/caricature/clr/isolation.rb +9 -0
- data/lib/caricature/clr/isolator.rb +4 -0
- data/lib/caricature/clr/messenger.rb +12 -17
- data/lib/caricature/clr.rb +1 -1
- data/lib/caricature/descriptor.rb +1 -1
- data/lib/caricature/expectation.rb +21 -11
- data/lib/caricature/isolation.rb +9 -3
- data/lib/caricature/isolator.rb +25 -9
- data/lib/caricature/messenger.rb +1 -1
- data/lib/caricature/verification.rb +2 -1
- data/lib/caricature/version.rb +6 -0
- data/lib/caricature.rb +8 -5
- data/spec/bacon_helper.rb +50 -30
- data/spec/bin/ClrModels.dll +0 -0
- data/spec/bin/ClrModels.dll.mdb +0 -0
- data/spec/integration/callback_spec.rb +157 -0
- data/spec/integration/ruby_to_ruby_spec.rb +12 -1
- data/spec/models/ClrModels.cs +8 -8
- data/spec/unit/expectation_spec.rb +35 -0
- metadata +35 -125
- data/.gitignore +0 -4
- data/README.markdown +0 -80
- data/VERSION +0 -1
- data/doc/Array.html +0 -251
- data/doc/Caricature/ArgumentRecording.html +0 -366
- data/doc/Caricature/ClrClassDescriptor.html +0 -303
- data/doc/Caricature/ClrClassMessenger.html +0 -263
- data/doc/Caricature/ClrInterfaceDescriptor.html +0 -295
- data/doc/Caricature/ClrInterfaceIsolator.html +0 -365
- data/doc/Caricature/ClrInterfaceMessenger.html +0 -260
- data/doc/Caricature/ClrIsolator.html +0 -425
- data/doc/Caricature/Expectation.html +0 -549
- data/doc/Caricature/ExpectationBuilder.html +0 -308
- data/doc/Caricature/ExpectationSyntax.html +0 -466
- data/doc/Caricature/Expectations.html +0 -347
- data/doc/Caricature/Interception/ClassMethods.html +0 -364
- data/doc/Caricature/Interception.html +0 -534
- data/doc/Caricature/Isolation.html +0 -763
- data/doc/Caricature/Isolator.html +0 -519
- data/doc/Caricature/MemberDescriptor.html +0 -335
- data/doc/Caricature/Messenger.html +0 -413
- data/doc/Caricature/MethodCallRecorder.html +0 -404
- data/doc/Caricature/MethodCallRecording.html +0 -493
- data/doc/Caricature/RubyIsolator.html +0 -416
- data/doc/Caricature/RubyMessenger.html +0 -261
- data/doc/Caricature/RubyObjectDescriptor.html +0 -289
- data/doc/Caricature/TypeDescriptor.html +0 -378
- data/doc/Caricature/Verification.html +0 -443
- data/doc/Caricature.html +0 -358
- data/doc/Class.html +0 -287
- data/doc/Hash.html +0 -255
- data/doc/Module.html +0 -287
- data/doc/Object.html +0 -409
- data/doc/README_markdown.html +0 -241
- data/doc/String.html +0 -369
- data/doc/System/String.html +0 -289
- data/doc/System/Type.html +0 -289
- data/doc/System.html +0 -207
- data/doc/created.rid +0 -1
- 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 +0 -342
- data/doc/js/darkfish.js +0 -116
- data/doc/js/jquery.js +0 -32
- data/doc/js/quicksearch.js +0 -114
- data/doc/js/thickbox-compressed.js +0 -10
- data/doc/lib/caricature/clr/aspnet_mvc_rb.html +0 -52
- data/doc/lib/caricature/clr/descriptor_rb.html +0 -52
- data/doc/lib/caricature/clr/isolation_rb.html +0 -52
- data/doc/lib/caricature/clr/isolator_rb.html +0 -52
- data/doc/lib/caricature/clr/messenger_rb.html +0 -52
- data/doc/lib/caricature/clr_rb.html +0 -52
- data/doc/lib/caricature/descriptor_rb.html +0 -52
- data/doc/lib/caricature/expectation_rb.html +0 -52
- data/doc/lib/caricature/isolation_rb.html +0 -52
- data/doc/lib/caricature/isolator_rb.html +0 -52
- data/doc/lib/caricature/messaging_rb.html +0 -52
- data/doc/lib/caricature/messenger_rb.html +0 -52
- data/doc/lib/caricature/method_call_recorder_rb.html +0 -52
- data/doc/lib/caricature/verification_rb.html +0 -52
- data/doc/lib/caricature_rb.html +0 -52
- data/doc/lib/core_ext/array_rb.html +0 -52
- data/doc/lib/core_ext/class_rb.html +0 -52
- data/doc/lib/core_ext/core_ext_rb.html +0 -52
- data/doc/lib/core_ext/hash_rb.html +0 -52
- data/doc/lib/core_ext/module_rb.html +0 -52
- data/doc/lib/core_ext/object_rb.html +0 -52
- data/doc/lib/core_ext/string_rb.html +0 -52
- data/doc/lib/core_ext/system/string_rb.html +0 -52
- data/doc/lib/core_ext/system/type_rb.html +0 -52
- data/doc/rdoc.css +0 -696
- data/irb_init.rb +0 -9
- data/lib/bin/Workarounds.dll +0 -0
- data/lib/bin/Workarounds.pdb +0 -0
- data/pkg/.gitignore +0 -0
- data/pkg/caricature-0.1.0.gem +0 -0
- data/pkg/caricature-0.5.0.gem +0 -0
- data/pkg/caricature-0.6.0.gem +0 -0
- data/spec/bin/.gitignore +0 -0
- data/workarounds/ReflectionHelper.cs +0 -30
@@ -1,519 +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>Class: Caricature::Isolator</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/isolator_rb.html?TB_iframe=true&height=550&width=785"
|
32
|
-
class="thickbox" title="lib/caricature/isolator.rb">lib/caricature/isolator.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="#M000080">::for</a></li>
|
63
|
-
|
64
|
-
<li><a href="#M000070">::new</a></li>
|
65
|
-
|
66
|
-
<li><a href="#M000071">#build_isolation</a></li>
|
67
|
-
|
68
|
-
<li><a href="#M000076">#class_name</a></li>
|
69
|
-
|
70
|
-
<li><a href="#M000078">#initialize_isolation</a></li>
|
71
|
-
|
72
|
-
<li><a href="#M000074">#initialize_messenger</a></li>
|
73
|
-
|
74
|
-
</ul>
|
75
|
-
</div>
|
76
|
-
|
77
|
-
|
78
|
-
<!-- Included Modules -->
|
79
|
-
|
80
|
-
</div>
|
81
|
-
|
82
|
-
<div id="project-metadata">
|
83
|
-
|
84
|
-
|
85
|
-
<div id="fileindex-section" class="section project-section">
|
86
|
-
<h3 class="section-header">Files</h3>
|
87
|
-
<ul>
|
88
|
-
|
89
|
-
<li class="file"><a href="../README_markdown.html">README.markdown</a></li>
|
90
|
-
|
91
|
-
</ul>
|
92
|
-
</div>
|
93
|
-
|
94
|
-
|
95
|
-
<div id="classindex-section" class="section project-section">
|
96
|
-
<h3 class="section-header">Class Index
|
97
|
-
<span class="search-toggle"><img src="../images/find.png"
|
98
|
-
height="16" width="16" alt="[+]"
|
99
|
-
title="show/hide quicksearch" /></span></h3>
|
100
|
-
<form action="#" method="get" accept-charset="utf-8" class="initially-hidden">
|
101
|
-
<fieldset>
|
102
|
-
<legend>Quicksearch</legend>
|
103
|
-
<input type="text" name="quicksearch" value=""
|
104
|
-
class="quicksearch-field" />
|
105
|
-
</fieldset>
|
106
|
-
</form>
|
107
|
-
|
108
|
-
<ul class="link-list">
|
109
|
-
|
110
|
-
<li><a href="../Caricature.html">Caricature</a></li>
|
111
|
-
|
112
|
-
<li><a href="../Caricature/ArgumentRecording.html">Caricature::ArgumentRecording</a></li>
|
113
|
-
|
114
|
-
<li><a href="../Caricature/ClrClassDescriptor.html">Caricature::ClrClassDescriptor</a></li>
|
115
|
-
|
116
|
-
<li><a href="../Caricature/ClrClassMessenger.html">Caricature::ClrClassMessenger</a></li>
|
117
|
-
|
118
|
-
<li><a href="../Caricature/ClrInterfaceDescriptor.html">Caricature::ClrInterfaceDescriptor</a></li>
|
119
|
-
|
120
|
-
<li><a href="../Caricature/ClrInterfaceIsolator.html">Caricature::ClrInterfaceIsolator</a></li>
|
121
|
-
|
122
|
-
<li><a href="../Caricature/ClrInterfaceMessenger.html">Caricature::ClrInterfaceMessenger</a></li>
|
123
|
-
|
124
|
-
<li><a href="../Caricature/ClrIsolator.html">Caricature::ClrIsolator</a></li>
|
125
|
-
|
126
|
-
<li><a href="../Caricature/Expectation.html">Caricature::Expectation</a></li>
|
127
|
-
|
128
|
-
<li><a href="../Caricature/ExpectationBuilder.html">Caricature::ExpectationBuilder</a></li>
|
129
|
-
|
130
|
-
<li><a href="../Caricature/ExpectationSyntax.html">Caricature::ExpectationSyntax</a></li>
|
131
|
-
|
132
|
-
<li><a href="../Caricature/Expectations.html">Caricature::Expectations</a></li>
|
133
|
-
|
134
|
-
<li><a href="../Caricature/Interception.html">Caricature::Interception</a></li>
|
135
|
-
|
136
|
-
<li><a href="../Caricature/Interception/ClassMethods.html">Caricature::Interception::ClassMethods</a></li>
|
137
|
-
|
138
|
-
<li><a href="../Caricature/Isolation.html">Caricature::Isolation</a></li>
|
139
|
-
|
140
|
-
<li><a href="../Caricature/Isolator.html">Caricature::Isolator</a></li>
|
141
|
-
|
142
|
-
<li><a href="../Caricature/MemberDescriptor.html">Caricature::MemberDescriptor</a></li>
|
143
|
-
|
144
|
-
<li><a href="../Caricature/Messenger.html">Caricature::Messenger</a></li>
|
145
|
-
|
146
|
-
<li><a href="../Caricature/MethodCallRecorder.html">Caricature::MethodCallRecorder</a></li>
|
147
|
-
|
148
|
-
<li><a href="../Caricature/MethodCallRecording.html">Caricature::MethodCallRecording</a></li>
|
149
|
-
|
150
|
-
<li><a href="../Caricature/RubyIsolator.html">Caricature::RubyIsolator</a></li>
|
151
|
-
|
152
|
-
<li><a href="../Caricature/RubyMessenger.html">Caricature::RubyMessenger</a></li>
|
153
|
-
|
154
|
-
<li><a href="../Caricature/RubyObjectDescriptor.html">Caricature::RubyObjectDescriptor</a></li>
|
155
|
-
|
156
|
-
<li><a href="../Caricature/TypeDescriptor.html">Caricature::TypeDescriptor</a></li>
|
157
|
-
|
158
|
-
<li><a href="../Caricature/Verification.html">Caricature::Verification</a></li>
|
159
|
-
|
160
|
-
<li><a href="../System.html">System</a></li>
|
161
|
-
|
162
|
-
<li><a href="../System/String.html">System::String</a></li>
|
163
|
-
|
164
|
-
<li><a href="../System/Type.html">System::Type</a></li>
|
165
|
-
|
166
|
-
<li><a href="../Array.html">Array</a></li>
|
167
|
-
|
168
|
-
<li><a href="../Class.html">Class</a></li>
|
169
|
-
|
170
|
-
<li><a href="../Hash.html">Hash</a></li>
|
171
|
-
|
172
|
-
<li><a href="../Module.html">Module</a></li>
|
173
|
-
|
174
|
-
<li><a href="../Object.html">Object</a></li>
|
175
|
-
|
176
|
-
<li><a href="../String.html">String</a></li>
|
177
|
-
|
178
|
-
</ul>
|
179
|
-
<div id="no-class-search-results" style="display: none;">No matching classes.</div>
|
180
|
-
</div>
|
181
|
-
|
182
|
-
|
183
|
-
</div>
|
184
|
-
</div>
|
185
|
-
|
186
|
-
<div id="documentation">
|
187
|
-
<h1 class="class">Caricature::Isolator</h1>
|
188
|
-
|
189
|
-
<div id="description">
|
190
|
-
<p>
|
191
|
-
A base class for <tt>Isolator</tt> objects to stick with the
|
192
|
-
<tt>Isolation</tt> nomenclature the strategies for creating isolations are
|
193
|
-
called isolators. An isolator functions as a barrier between the code in
|
194
|
-
your test and the underlying type/instance. It allows you to take control
|
195
|
-
over the value that is returned from a specific method, if you want to pass
|
196
|
-
the method call along to the underlying instance etc. It also contains the
|
197
|
-
ability to verify if a method was called, with which arguments etc.
|
198
|
-
</p>
|
199
|
-
|
200
|
-
</div>
|
201
|
-
|
202
|
-
<!-- Constants -->
|
203
|
-
|
204
|
-
|
205
|
-
<!-- Attributes -->
|
206
|
-
|
207
|
-
<div id="attribute-method-details" class="method-section section">
|
208
|
-
<h3 class="section-header">Attributes</h3>
|
209
|
-
|
210
|
-
|
211
|
-
<div id="isolation-attribute-method" class="method-detail">
|
212
|
-
<a name="isolation"></a>
|
213
|
-
|
214
|
-
<div class="method-heading attribute-method-heading">
|
215
|
-
<span class="method-name">isolation</span><span
|
216
|
-
class="attribute-access-type">[R]</span>
|
217
|
-
</div>
|
218
|
-
|
219
|
-
<div class="method-description">
|
220
|
-
|
221
|
-
<p>
|
222
|
-
holds the isolation created by this isolator
|
223
|
-
</p>
|
224
|
-
|
225
|
-
</div>
|
226
|
-
</div>
|
227
|
-
|
228
|
-
<div id="subject-attribute-method" class="method-detail">
|
229
|
-
<a name="subject"></a>
|
230
|
-
|
231
|
-
<div class="method-heading attribute-method-heading">
|
232
|
-
<span class="method-name">subject</span><span
|
233
|
-
class="attribute-access-type">[R]</span>
|
234
|
-
</div>
|
235
|
-
|
236
|
-
<div class="method-description">
|
237
|
-
|
238
|
-
<p>
|
239
|
-
holds the subject of this isolator
|
240
|
-
</p>
|
241
|
-
|
242
|
-
</div>
|
243
|
-
</div>
|
244
|
-
|
245
|
-
<div id="descriptor-attribute-method" class="method-detail">
|
246
|
-
<a name="descriptor"></a>
|
247
|
-
|
248
|
-
<div class="method-heading attribute-method-heading">
|
249
|
-
<span class="method-name">descriptor</span><span
|
250
|
-
class="attribute-access-type">[R]</span>
|
251
|
-
</div>
|
252
|
-
|
253
|
-
<div class="method-description">
|
254
|
-
|
255
|
-
<p>
|
256
|
-
holds the descriptor for this type of object
|
257
|
-
</p>
|
258
|
-
|
259
|
-
</div>
|
260
|
-
</div>
|
261
|
-
|
262
|
-
</div>
|
263
|
-
|
264
|
-
|
265
|
-
<!-- Methods -->
|
266
|
-
|
267
|
-
<div id="public-class-method-details" class="method-section section">
|
268
|
-
<h3 class="section-header">Public Class Methods</h3>
|
269
|
-
|
270
|
-
|
271
|
-
<div id="for-method" class="method-detail ">
|
272
|
-
<a name="M000080"></a>
|
273
|
-
|
274
|
-
<div class="method-heading">
|
275
|
-
|
276
|
-
<span class="method-name">for</span><span
|
277
|
-
class="method-args">(context)</span>
|
278
|
-
<span class="method-click-advice">click to toggle source</span>
|
279
|
-
|
280
|
-
</div>
|
281
|
-
|
282
|
-
<div class="method-description">
|
283
|
-
|
284
|
-
<p>
|
285
|
-
Creates the actual proxy object for the <tt>subject</tt> and initializes it
|
286
|
-
with a <tt>recorder</tt> and <tt>expectations</tt> This is the actual
|
287
|
-
isolation that will be used to in your tests. It implements all the methods
|
288
|
-
of the <tt>subject</tt> so as long as you’re in Ruby and just need to
|
289
|
-
isolate out some classes defined in a statically compiled language it
|
290
|
-
should get you all the way there for public instance methods at this point.
|
291
|
-
when you’re going to isolation for usage within a statically compiled
|
292
|
-
language type then you’re bound to most of their rules. So you need
|
293
|
-
to either isolate interfaces or mark the methods you want to isolate as
|
294
|
-
virtual in your implementing classes.
|
295
|
-
</p>
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
<div class="method-source-code"
|
300
|
-
id="for-source">
|
301
|
-
<pre>
|
302
|
-
<span class="ruby-comment cmt"># File lib/caricature/isolator.rb, line 219</span>
|
303
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">for</span>(<span class="ruby-identifier">context</span>)
|
304
|
-
<span class="ruby-identifier">context</span>.<span class="ruby-identifier">recorder</span> <span class="ruby-operator">||=</span> <span class="ruby-constant">MethodCallRecorder</span>.<span class="ruby-identifier">new</span>
|
305
|
-
<span class="ruby-identifier">context</span>.<span class="ruby-identifier">expectations</span> <span class="ruby-operator">||=</span> <span class="ruby-constant">Expectations</span>.<span class="ruby-identifier">new</span>
|
306
|
-
<span class="ruby-identifier">new</span>(<span class="ruby-identifier">context</span>)
|
307
|
-
<span class="ruby-keyword kw">end</span></pre>
|
308
|
-
</div>
|
309
|
-
|
310
|
-
</div>
|
311
|
-
|
312
|
-
|
313
|
-
</div>
|
314
|
-
|
315
|
-
|
316
|
-
<div id="new-method" class="method-detail ">
|
317
|
-
<a name="M000070"></a>
|
318
|
-
|
319
|
-
<div class="method-heading">
|
320
|
-
|
321
|
-
<span class="method-name">new</span><span
|
322
|
-
class="method-args">(context)</span>
|
323
|
-
<span class="method-click-advice">click to toggle source</span>
|
324
|
-
|
325
|
-
</div>
|
326
|
-
|
327
|
-
<div class="method-description">
|
328
|
-
|
329
|
-
<p>
|
330
|
-
creates a new instance of an isolator
|
331
|
-
</p>
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
<div class="method-source-code"
|
336
|
-
id="new-source">
|
337
|
-
<pre>
|
338
|
-
<span class="ruby-comment cmt"># File lib/caricature/isolator.rb, line 177</span>
|
339
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">context</span>)
|
340
|
-
<span class="ruby-ivar">@context</span> = <span class="ruby-identifier">context</span>
|
341
|
-
<span class="ruby-keyword kw">end</span></pre>
|
342
|
-
</div>
|
343
|
-
|
344
|
-
</div>
|
345
|
-
|
346
|
-
|
347
|
-
</div>
|
348
|
-
|
349
|
-
|
350
|
-
</div>
|
351
|
-
|
352
|
-
<div id="public-instance-method-details" class="method-section section">
|
353
|
-
<h3 class="section-header">Public Instance Methods</h3>
|
354
|
-
|
355
|
-
|
356
|
-
<div id="build-isolation-method" class="method-detail ">
|
357
|
-
<a name="M000071"></a>
|
358
|
-
|
359
|
-
<div class="method-heading">
|
360
|
-
|
361
|
-
<span class="method-name">build_isolation</span><span
|
362
|
-
class="method-args">(klass, inst=nil)</span>
|
363
|
-
<span class="method-click-advice">click to toggle source</span>
|
364
|
-
|
365
|
-
</div>
|
366
|
-
|
367
|
-
<div class="method-description">
|
368
|
-
|
369
|
-
<p>
|
370
|
-
builds up the isolation class instance
|
371
|
-
</p>
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
<div class="method-source-code"
|
376
|
-
id="build-isolation-source">
|
377
|
-
<pre>
|
378
|
-
<span class="ruby-comment cmt"># File lib/caricature/isolator.rb, line 182</span>
|
379
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">build_isolation</span>(<span class="ruby-identifier">klass</span>, <span class="ruby-identifier">inst</span>=<span class="ruby-keyword kw">nil</span>)
|
380
|
-
<span class="ruby-identifier">pxy</span> = <span class="ruby-identifier">create_isolation_for</span> <span class="ruby-identifier">klass</span>
|
381
|
-
<span class="ruby-ivar">@isolation</span> = <span class="ruby-identifier">pxy</span>.<span class="ruby-identifier">new</span>
|
382
|
-
<span class="ruby-ivar">@subject</span> = <span class="ruby-identifier">inst</span>
|
383
|
-
<span class="ruby-identifier">initialize_messenger</span>
|
384
|
-
<span class="ruby-keyword kw">end</span></pre>
|
385
|
-
</div>
|
386
|
-
|
387
|
-
</div>
|
388
|
-
|
389
|
-
|
390
|
-
</div>
|
391
|
-
|
392
|
-
|
393
|
-
<div id="class-name-method" class="method-detail ">
|
394
|
-
<a name="M000076"></a>
|
395
|
-
|
396
|
-
<div class="method-heading">
|
397
|
-
|
398
|
-
<span class="method-name">class_name</span><span
|
399
|
-
class="method-args">(subj)</span>
|
400
|
-
<span class="method-click-advice">click to toggle source</span>
|
401
|
-
|
402
|
-
</div>
|
403
|
-
|
404
|
-
<div class="method-description">
|
405
|
-
|
406
|
-
<p>
|
407
|
-
Creates the new class name for the isolation
|
408
|
-
</p>
|
409
|
-
|
410
|
-
|
411
|
-
|
412
|
-
<div class="method-source-code"
|
413
|
-
id="class-name-source">
|
414
|
-
<pre>
|
415
|
-
<span class="ruby-comment cmt"># File lib/caricature/isolator.rb, line 195</span>
|
416
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">class_name</span>(<span class="ruby-identifier">subj</span>)
|
417
|
-
<span class="ruby-identifier">nm</span> = <span class="ruby-identifier">subj</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-identifier">:class_eval</span>) <span class="ruby-operator">?</span> <span class="ruby-identifier">subj</span>.<span class="ruby-identifier">demodulize</span> <span class="ruby-operator">:</span> <span class="ruby-identifier">subj</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">demodulize</span>
|
418
|
-
<span class="ruby-ivar">@class_name</span> = <span class="ruby-node">"#{nm}#{System::Guid.new_guid.to_string('n')}"</span>
|
419
|
-
<span class="ruby-ivar">@class_name</span>
|
420
|
-
<span class="ruby-keyword kw">end</span></pre>
|
421
|
-
</div>
|
422
|
-
|
423
|
-
</div>
|
424
|
-
|
425
|
-
|
426
|
-
</div>
|
427
|
-
|
428
|
-
|
429
|
-
<div id="initialize-isolation-method" class="method-detail ">
|
430
|
-
<a name="M000078"></a>
|
431
|
-
|
432
|
-
<div class="method-heading">
|
433
|
-
|
434
|
-
<span class="method-name">initialize_isolation</span><span
|
435
|
-
class="method-args">(klass, context)</span>
|
436
|
-
<span class="method-click-advice">click to toggle source</span>
|
437
|
-
|
438
|
-
</div>
|
439
|
-
|
440
|
-
<div class="method-description">
|
441
|
-
|
442
|
-
<p>
|
443
|
-
Sets up the necessary instance variables for the isolation
|
444
|
-
</p>
|
445
|
-
|
446
|
-
|
447
|
-
|
448
|
-
<div class="method-source-code"
|
449
|
-
id="initialize-isolation-source">
|
450
|
-
<pre>
|
451
|
-
<span class="ruby-comment cmt"># File lib/caricature/isolator.rb, line 202</span>
|
452
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize_isolation</span>(<span class="ruby-identifier">klass</span>, <span class="ruby-identifier">context</span>)
|
453
|
-
<span class="ruby-identifier">pxy</span> = <span class="ruby-identifier">klass</span>.<span class="ruby-identifier">new</span>
|
454
|
-
<span class="ruby-identifier">pxy</span>.<span class="ruby-identifier">instance_variable_set</span>(<span class="ruby-value str">"@___context___"</span>, <span class="ruby-identifier">context</span>)
|
455
|
-
<span class="ruby-identifier">pxy</span>
|
456
|
-
<span class="ruby-keyword kw">end</span></pre>
|
457
|
-
</div>
|
458
|
-
|
459
|
-
</div>
|
460
|
-
|
461
|
-
|
462
|
-
</div>
|
463
|
-
|
464
|
-
|
465
|
-
<div id="initialize-messenger-method" class="method-detail ">
|
466
|
-
<a name="M000074"></a>
|
467
|
-
|
468
|
-
<div class="method-heading">
|
469
|
-
|
470
|
-
<span class="method-name">initialize_messenger</span><span
|
471
|
-
class="method-args">()</span>
|
472
|
-
<span class="method-click-advice">click to toggle source</span>
|
473
|
-
|
474
|
-
</div>
|
475
|
-
|
476
|
-
<div class="method-description">
|
477
|
-
|
478
|
-
<p>
|
479
|
-
initializes the messaging strategy for the isolator
|
480
|
-
</p>
|
481
|
-
|
482
|
-
|
483
|
-
|
484
|
-
<div class="method-source-code"
|
485
|
-
id="initialize-messenger-source">
|
486
|
-
<pre>
|
487
|
-
<span class="ruby-comment cmt"># File lib/caricature/isolator.rb, line 190</span>
|
488
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize_messenger</span>
|
489
|
-
<span class="ruby-identifier">raise</span> <span class="ruby-constant">NotImplementedError</span>
|
490
|
-
<span class="ruby-keyword kw">end</span></pre>
|
491
|
-
</div>
|
492
|
-
|
493
|
-
</div>
|
494
|
-
|
495
|
-
|
496
|
-
</div>
|
497
|
-
|
498
|
-
|
499
|
-
</div>
|
500
|
-
|
501
|
-
|
502
|
-
</div>
|
503
|
-
|
504
|
-
|
505
|
-
<div id="rdoc-debugging-section-dump" class="debugging-section">
|
506
|
-
|
507
|
-
<p>Disabled; run with --debug to generate this.</p>
|
508
|
-
|
509
|
-
</div>
|
510
|
-
|
511
|
-
<div id="validator-badges">
|
512
|
-
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
513
|
-
<p><small>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish
|
514
|
-
Rdoc Generator</a> 1.1.6</small>.</p>
|
515
|
-
</div>
|
516
|
-
|
517
|
-
</body>
|
518
|
-
</html>
|
519
|
-
|