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
data/doc/Object.html
DELETED
@@ -1,409 +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: Object</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/core_ext/object_rb.html?TB_iframe=true&height=550&width=785"
|
32
|
-
class="thickbox" title="lib/core_ext/object.rb">lib/core_ext/object.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="#M000103">#define_cmethod</a></li>
|
63
|
-
|
64
|
-
<li><a href="#M000003">#http_context_isolation</a></li>
|
65
|
-
|
66
|
-
<li><a href="#M000101">#is_clr_type?</a></li>
|
67
|
-
|
68
|
-
<li><a href="#M000006">#setup_request_url</a></li>
|
69
|
-
|
70
|
-
<li><a href="#M000102">#to_clr_type</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">Object</h1>
|
186
|
-
|
187
|
-
<div id="description">
|
188
|
-
|
189
|
-
</div>
|
190
|
-
|
191
|
-
<!-- Constants -->
|
192
|
-
|
193
|
-
|
194
|
-
<!-- Attributes -->
|
195
|
-
|
196
|
-
|
197
|
-
<!-- Methods -->
|
198
|
-
|
199
|
-
<div id="public-instance-method-details" class="method-section section">
|
200
|
-
<h3 class="section-header">Public Instance Methods</h3>
|
201
|
-
|
202
|
-
|
203
|
-
<div id="define-cmethod-method" class="method-detail ">
|
204
|
-
<a name="M000103"></a>
|
205
|
-
|
206
|
-
<div class="method-heading">
|
207
|
-
|
208
|
-
<span class="method-name">define_cmethod</span><span
|
209
|
-
class="method-args">(name, &blk)</span>
|
210
|
-
<span class="method-click-advice">click to toggle source</span>
|
211
|
-
|
212
|
-
</div>
|
213
|
-
|
214
|
-
<div class="method-description">
|
215
|
-
|
216
|
-
<p>
|
217
|
-
defines a class method on an object
|
218
|
-
</p>
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
<div class="method-source-code"
|
223
|
-
id="define-cmethod-source">
|
224
|
-
<pre>
|
225
|
-
<span class="ruby-comment cmt"># File lib/core_ext/object.rb, line 15</span>
|
226
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">define_cmethod</span>(<span class="ruby-identifier">name</span>, <span class="ruby-operator">&</span><span class="ruby-identifier">blk</span>)
|
227
|
-
(<span class="ruby-keyword kw">class</span> <span class="ruby-operator"><<</span> <span class="ruby-keyword kw">self</span>; <span class="ruby-keyword kw">self</span>; <span class="ruby-keyword kw">end</span>).<span class="ruby-identifier">instance_eval</span> { <span class="ruby-identifier">define_method</span> <span class="ruby-identifier">name</span>, <span class="ruby-operator">&</span><span class="ruby-identifier">blk</span> }
|
228
|
-
<span class="ruby-keyword kw">end</span></pre>
|
229
|
-
</div>
|
230
|
-
|
231
|
-
</div>
|
232
|
-
|
233
|
-
|
234
|
-
</div>
|
235
|
-
|
236
|
-
|
237
|
-
<div id="http-context-isolation-method" class="method-detail ">
|
238
|
-
<a name="M000003"></a>
|
239
|
-
|
240
|
-
<div class="method-heading">
|
241
|
-
|
242
|
-
<span class="method-name">http_context_isolation</span><span
|
243
|
-
class="method-args">(url="")</span>
|
244
|
-
<span class="method-click-advice">click to toggle source</span>
|
245
|
-
|
246
|
-
</div>
|
247
|
-
|
248
|
-
<div class="method-description">
|
249
|
-
|
250
|
-
<p class="missing-docs">(Not documented)</p>
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
<div class="method-source-code"
|
255
|
-
id="http-context-isolation-source">
|
256
|
-
<pre>
|
257
|
-
<span class="ruby-comment cmt"># File lib/caricature/clr/aspnet_mvc.rb, line 26</span>
|
258
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">http_context_isolation</span>(<span class="ruby-identifier">url</span>=<span class="ruby-value str">""</span>)
|
259
|
-
|
260
|
-
<span class="ruby-identifier">context</span> = <span class="ruby-constant">Caricature</span><span class="ruby-operator">::</span><span class="ruby-constant">Isolation</span>.<span class="ruby-identifier">for</span>(<span class="ruby-constant">HttpContextBase</span>)
|
261
|
-
<span class="ruby-identifier">request</span> = <span class="ruby-constant">Caricature</span><span class="ruby-operator">::</span><span class="ruby-constant">Isolation</span>.<span class="ruby-identifier">for</span>(<span class="ruby-constant">HttpRequestBase</span>)
|
262
|
-
<span class="ruby-identifier">response</span> = <span class="ruby-constant">Caricature</span><span class="ruby-operator">::</span><span class="ruby-constant">Isolation</span>.<span class="ruby-identifier">for</span>(<span class="ruby-constant">HttpResponseBase</span>)
|
263
|
-
<span class="ruby-identifier">session</span> = <span class="ruby-constant">Caricature</span><span class="ruby-operator">::</span><span class="ruby-constant">Isolation</span>.<span class="ruby-identifier">for</span>(<span class="ruby-constant">HttpSessionStateBase</span>)
|
264
|
-
<span class="ruby-identifier">server</span> = <span class="ruby-constant">Caricature</span><span class="ruby-operator">::</span><span class="ruby-constant">Isolation</span>.<span class="ruby-identifier">for</span>(<span class="ruby-constant">HttpServerUtilityBase</span>)
|
265
|
-
|
266
|
-
<span class="ruby-identifier">context</span>.<span class="ruby-identifier">when_receiving</span>(<span class="ruby-identifier">:request</span>).<span class="ruby-identifier">return</span>(<span class="ruby-identifier">request</span>)
|
267
|
-
<span class="ruby-identifier">context</span>.<span class="ruby-identifier">when_receiving</span>(<span class="ruby-identifier">:response</span>).<span class="ruby-identifier">return</span>(<span class="ruby-identifier">response</span>)
|
268
|
-
<span class="ruby-identifier">context</span>.<span class="ruby-identifier">when_receiving</span>(<span class="ruby-identifier">:session</span>).<span class="ruby-identifier">return</span>(<span class="ruby-identifier">session</span>)
|
269
|
-
<span class="ruby-identifier">context</span>.<span class="ruby-identifier">when_receiving</span>(<span class="ruby-identifier">:server</span>).<span class="ruby-identifier">return</span>(<span class="ruby-identifier">server</span>)
|
270
|
-
|
271
|
-
<span class="ruby-identifier">setup_request_url</span>(<span class="ruby-identifier">context</span>.<span class="ruby-identifier">request</span>, <span class="ruby-identifier">url</span>) <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">url</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-keyword kw">or</span> <span class="ruby-identifier">url</span>.<span class="ruby-identifier">empty?</span>
|
272
|
-
|
273
|
-
<span class="ruby-identifier">context</span>
|
274
|
-
<span class="ruby-keyword kw">end</span></pre>
|
275
|
-
</div>
|
276
|
-
|
277
|
-
</div>
|
278
|
-
|
279
|
-
|
280
|
-
</div>
|
281
|
-
|
282
|
-
|
283
|
-
<div id="is-clr-type--method" class="method-detail ">
|
284
|
-
<a name="M000101"></a>
|
285
|
-
|
286
|
-
<div class="method-heading">
|
287
|
-
|
288
|
-
<span class="method-name">is_clr_type?</span><span
|
289
|
-
class="method-args">()</span>
|
290
|
-
<span class="method-click-advice">click to toggle source</span>
|
291
|
-
|
292
|
-
</div>
|
293
|
-
|
294
|
-
<div class="method-description">
|
295
|
-
|
296
|
-
<p>
|
297
|
-
returns whether this object is a clr_type. if it has a CLR type in one of
|
298
|
-
its ancestors
|
299
|
-
</p>
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
<div class="method-source-code"
|
304
|
-
id="is-clr-type--source">
|
305
|
-
<pre>
|
306
|
-
<span class="ruby-comment cmt"># File lib/core_ext/object.rb, line 5</span>
|
307
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">is_clr_type?</span>
|
308
|
-
<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">is_clr_type?</span>
|
309
|
-
<span class="ruby-keyword kw">end</span></pre>
|
310
|
-
</div>
|
311
|
-
|
312
|
-
</div>
|
313
|
-
|
314
|
-
|
315
|
-
</div>
|
316
|
-
|
317
|
-
|
318
|
-
<div id="setup-request-url-method" class="method-detail ">
|
319
|
-
<a name="M000006"></a>
|
320
|
-
|
321
|
-
<div class="method-heading">
|
322
|
-
|
323
|
-
<span class="method-name">setup_request_url</span><span
|
324
|
-
class="method-args">(request, url)</span>
|
325
|
-
<span class="method-click-advice">click to toggle source</span>
|
326
|
-
|
327
|
-
</div>
|
328
|
-
|
329
|
-
<div class="method-description">
|
330
|
-
|
331
|
-
<p class="missing-docs">(Not documented)</p>
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
<div class="method-source-code"
|
336
|
-
id="setup-request-url-source">
|
337
|
-
<pre>
|
338
|
-
<span class="ruby-comment cmt"># File lib/caricature/clr/aspnet_mvc.rb, line 44</span>
|
339
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">setup_request_url</span>(<span class="ruby-identifier">request</span>, <span class="ruby-identifier">url</span>)
|
340
|
-
<span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value str">"url should not be nil"</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">url</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-keyword kw">or</span> <span class="ruby-identifier">url</span>.<span class="ruby-identifier">empty?</span>
|
341
|
-
<span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value str">"we expect a url to start with '~/'."</span>) <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">url</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/^~\//</span>
|
342
|
-
|
343
|
-
<span class="ruby-identifier">request</span>.<span class="ruby-identifier">when_receiving</span>(<span class="ruby-identifier">:query_string</span>).<span class="ruby-identifier">return</span>(<span class="ruby-identifier">url</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">to_qs_parameters</span>)
|
344
|
-
<span class="ruby-identifier">request</span>.<span class="ruby-identifier">when_receiving</span>(<span class="ruby-identifier">:app_relative_current_execution_file_path</span>).<span class="ruby-identifier">return</span>(<span class="ruby-identifier">url</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">to_url_filename</span>)
|
345
|
-
<span class="ruby-identifier">request</span>.<span class="ruby-identifier">when_receiving</span>(<span class="ruby-identifier">:path_info</span>).<span class="ruby-identifier">return</span>(<span class="ruby-value str">""</span>)
|
346
|
-
<span class="ruby-keyword kw">end</span></pre>
|
347
|
-
</div>
|
348
|
-
|
349
|
-
</div>
|
350
|
-
|
351
|
-
|
352
|
-
</div>
|
353
|
-
|
354
|
-
|
355
|
-
<div id="to-clr-type-method" class="method-detail ">
|
356
|
-
<a name="M000102"></a>
|
357
|
-
|
358
|
-
<div class="method-heading">
|
359
|
-
|
360
|
-
<span class="method-name">to_clr_type</span><span
|
361
|
-
class="method-args">()</span>
|
362
|
-
<span class="method-click-advice">click to toggle source</span>
|
363
|
-
|
364
|
-
</div>
|
365
|
-
|
366
|
-
<div class="method-description">
|
367
|
-
|
368
|
-
<p>
|
369
|
-
returns the clr type of this object if any
|
370
|
-
</p>
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
<div class="method-source-code"
|
375
|
-
id="to-clr-type-source">
|
376
|
-
<pre>
|
377
|
-
<span class="ruby-comment cmt"># File lib/core_ext/object.rb, line 10</span>
|
378
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_clr_type</span>
|
379
|
-
<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">to_clr_type</span>
|
380
|
-
<span class="ruby-keyword kw">end</span></pre>
|
381
|
-
</div>
|
382
|
-
|
383
|
-
</div>
|
384
|
-
|
385
|
-
|
386
|
-
</div>
|
387
|
-
|
388
|
-
|
389
|
-
</div>
|
390
|
-
|
391
|
-
|
392
|
-
</div>
|
393
|
-
|
394
|
-
|
395
|
-
<div id="rdoc-debugging-section-dump" class="debugging-section">
|
396
|
-
|
397
|
-
<p>Disabled; run with --debug to generate this.</p>
|
398
|
-
|
399
|
-
</div>
|
400
|
-
|
401
|
-
<div id="validator-badges">
|
402
|
-
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
403
|
-
<p><small>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish
|
404
|
-
Rdoc Generator</a> 1.1.6</small>.</p>
|
405
|
-
</div>
|
406
|
-
|
407
|
-
</body>
|
408
|
-
</html>
|
409
|
-
|
data/doc/README_markdown.html
DELETED
@@ -1,241 +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
|
-
|
5
|
-
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
6
|
-
<head>
|
7
|
-
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
|
8
|
-
|
9
|
-
<title>File: README.markdown [Caricature isolation framework documentation]</title>
|
10
|
-
|
11
|
-
<link type="text/css" media="screen" href="./rdoc.css" rel="stylesheet" />
|
12
|
-
|
13
|
-
<script src="./js/jquery.js" type="text/javascript"
|
14
|
-
charset="utf-8"></script>
|
15
|
-
<script src="./js/thickbox-compressed.js" type="text/javascript"
|
16
|
-
charset="utf-8"></script>
|
17
|
-
<script src="./js/quicksearch.js" type="text/javascript"
|
18
|
-
charset="utf-8"></script>
|
19
|
-
<script src="./js/darkfish.js" type="text/javascript"
|
20
|
-
charset="utf-8"></script>
|
21
|
-
</head>
|
22
|
-
|
23
|
-
<body class="file">
|
24
|
-
<div id="metadata">
|
25
|
-
<div id="project-metadata">
|
26
|
-
|
27
|
-
|
28
|
-
<div id="fileindex-section" class="section project-section">
|
29
|
-
<h3 class="section-header">Files</h3>
|
30
|
-
<ul>
|
31
|
-
|
32
|
-
<li class="file"><a href="./README_markdown.html">README.markdown</a></li>
|
33
|
-
|
34
|
-
</ul>
|
35
|
-
</div>
|
36
|
-
|
37
|
-
|
38
|
-
<div id="classindex-section" class="section project-section">
|
39
|
-
<h3 class="section-header">Class Index
|
40
|
-
<span class="search-toggle"><img src="./images/find.png"
|
41
|
-
height="16" width="16" alt="[+]"
|
42
|
-
title="show/hide quicksearch" /></span></h3>
|
43
|
-
<form action="#" method="get" accept-charset="utf-8" class="initially-hidden">
|
44
|
-
<fieldset>
|
45
|
-
<legend>Quicksearch</legend>
|
46
|
-
<input type="text" name="quicksearch" value=""
|
47
|
-
class="quicksearch-field" />
|
48
|
-
</fieldset>
|
49
|
-
</form>
|
50
|
-
|
51
|
-
<ul class="link-list">
|
52
|
-
|
53
|
-
<li><a href="./Caricature.html">Caricature</a></li>
|
54
|
-
|
55
|
-
<li><a href="./Caricature/ArgumentRecording.html">Caricature::ArgumentRecording</a></li>
|
56
|
-
|
57
|
-
<li><a href="./Caricature/ClrClassDescriptor.html">Caricature::ClrClassDescriptor</a></li>
|
58
|
-
|
59
|
-
<li><a href="./Caricature/ClrClassMessenger.html">Caricature::ClrClassMessenger</a></li>
|
60
|
-
|
61
|
-
<li><a href="./Caricature/ClrInterfaceDescriptor.html">Caricature::ClrInterfaceDescriptor</a></li>
|
62
|
-
|
63
|
-
<li><a href="./Caricature/ClrInterfaceIsolator.html">Caricature::ClrInterfaceIsolator</a></li>
|
64
|
-
|
65
|
-
<li><a href="./Caricature/ClrInterfaceMessenger.html">Caricature::ClrInterfaceMessenger</a></li>
|
66
|
-
|
67
|
-
<li><a href="./Caricature/ClrIsolator.html">Caricature::ClrIsolator</a></li>
|
68
|
-
|
69
|
-
<li><a href="./Caricature/Expectation.html">Caricature::Expectation</a></li>
|
70
|
-
|
71
|
-
<li><a href="./Caricature/ExpectationBuilder.html">Caricature::ExpectationBuilder</a></li>
|
72
|
-
|
73
|
-
<li><a href="./Caricature/ExpectationSyntax.html">Caricature::ExpectationSyntax</a></li>
|
74
|
-
|
75
|
-
<li><a href="./Caricature/Expectations.html">Caricature::Expectations</a></li>
|
76
|
-
|
77
|
-
<li><a href="./Caricature/Interception.html">Caricature::Interception</a></li>
|
78
|
-
|
79
|
-
<li><a href="./Caricature/Interception/ClassMethods.html">Caricature::Interception::ClassMethods</a></li>
|
80
|
-
|
81
|
-
<li><a href="./Caricature/Isolation.html">Caricature::Isolation</a></li>
|
82
|
-
|
83
|
-
<li><a href="./Caricature/Isolator.html">Caricature::Isolator</a></li>
|
84
|
-
|
85
|
-
<li><a href="./Caricature/MemberDescriptor.html">Caricature::MemberDescriptor</a></li>
|
86
|
-
|
87
|
-
<li><a href="./Caricature/Messenger.html">Caricature::Messenger</a></li>
|
88
|
-
|
89
|
-
<li><a href="./Caricature/MethodCallRecorder.html">Caricature::MethodCallRecorder</a></li>
|
90
|
-
|
91
|
-
<li><a href="./Caricature/MethodCallRecording.html">Caricature::MethodCallRecording</a></li>
|
92
|
-
|
93
|
-
<li><a href="./Caricature/RubyIsolator.html">Caricature::RubyIsolator</a></li>
|
94
|
-
|
95
|
-
<li><a href="./Caricature/RubyMessenger.html">Caricature::RubyMessenger</a></li>
|
96
|
-
|
97
|
-
<li><a href="./Caricature/RubyObjectDescriptor.html">Caricature::RubyObjectDescriptor</a></li>
|
98
|
-
|
99
|
-
<li><a href="./Caricature/TypeDescriptor.html">Caricature::TypeDescriptor</a></li>
|
100
|
-
|
101
|
-
<li><a href="./Caricature/Verification.html">Caricature::Verification</a></li>
|
102
|
-
|
103
|
-
<li><a href="./System.html">System</a></li>
|
104
|
-
|
105
|
-
<li><a href="./System/String.html">System::String</a></li>
|
106
|
-
|
107
|
-
<li><a href="./System/Type.html">System::Type</a></li>
|
108
|
-
|
109
|
-
<li><a href="./Array.html">Array</a></li>
|
110
|
-
|
111
|
-
<li><a href="./Class.html">Class</a></li>
|
112
|
-
|
113
|
-
<li><a href="./Hash.html">Hash</a></li>
|
114
|
-
|
115
|
-
<li><a href="./Module.html">Module</a></li>
|
116
|
-
|
117
|
-
<li><a href="./Object.html">Object</a></li>
|
118
|
-
|
119
|
-
<li><a href="./String.html">String</a></li>
|
120
|
-
|
121
|
-
</ul>
|
122
|
-
<div id="no-class-search-results" style="display: none;">No matching classes.</div>
|
123
|
-
</div>
|
124
|
-
|
125
|
-
|
126
|
-
</div>
|
127
|
-
</div>
|
128
|
-
|
129
|
-
<div id="documentation">
|
130
|
-
<p>
|
131
|
-
<a href="Caricature.html">Caricature</a> - Bringing simple mocking to the
|
132
|
-
DLR
|
133
|
-
</p>
|
134
|
-
<h6>=========================================</h6>
|
135
|
-
<p>
|
136
|
-
This project aims to make interop between IronRuby objects and .NET objects
|
137
|
-
easier. The idea is that it integrates nicely with bacon and later rspec
|
138
|
-
and that it transparently lets you mock ironruby ojbects as well as CLR
|
139
|
-
objects/interfaces. <a href="Caricature.html">Caricature</a> handles
|
140
|
-
interfaces, interface inheritance, CLR objects, CLR object instances, Ruby
|
141
|
-
classes and instances of Ruby classes.
|
142
|
-
</p>
|
143
|
-
<p>
|
144
|
-
From the start I wanted to do away with names like mock, stub, record,
|
145
|
-
replay, verify etc. Instead I took the advice from Roy Osherhove and went
|
146
|
-
with a name of Isolation for creating a mock.
|
147
|
-
</p>
|
148
|
-
<p>
|
149
|
-
An Isolation will create what in Rhino.Mocks would be called a DynamicMock
|
150
|
-
(but can be a partial too) :) In Moq it would be the Loose mocking
|
151
|
-
strategy.
|
152
|
-
</p>
|
153
|
-
<p>
|
154
|
-
The naming of the methods for creating mocks is the one that JP Boodhoo
|
155
|
-
proposed WhenToldTo and WasToldTo. To specify a stub/expectation on an
|
156
|
-
isolation you have one and only one way of doing that with the method
|
157
|
-
called when_receiving. Then only if you’re interested in asserting if
|
158
|
-
a method has been called you can use the did_receive? method for this.
|
159
|
-
</p>
|
160
|
-
<p>
|
161
|
-
<pre> isolation = Isolation.for(Ninja) isolation.when_receiving(:attack) do
|
162
|
-
|exp|
|
163
|
-
</p>
|
164
|
-
<pre>
|
165
|
-
exp.with(:shuriken)
|
166
|
-
exp.return(3)
|
167
|
-
</pre>
|
168
|
-
<p>
|
169
|
-
end
|
170
|
-
</p>
|
171
|
-
<p>
|
172
|
-
Battle.new(mock) battle.combat
|
173
|
-
</p>
|
174
|
-
<p>
|
175
|
-
isolation.did_receive?(:attack).should.be.true? </pre>
|
176
|
-
</p>
|
177
|
-
<p>
|
178
|
-
It may be very important to note that when you’re going to be
|
179
|
-
isolating CLR classes to be used in other CLR classes you still need to
|
180
|
-
obide by the CLR rules. That means if you want to redefine a method
|
181
|
-
you’ll need to make sure it’s marked as virtual. Static types
|
182
|
-
are still governed by static type rules. I’m working on a solution
|
183
|
-
around those problems but for the time being this is how it has to be.
|
184
|
-
</p>
|
185
|
-
<p>
|
186
|
-
License:
|
187
|
-
</p>
|
188
|
-
<hr size="6"></hr><pre>
|
189
|
-
Caricature -- A simple mocking framework for IronRuby
|
190
|
-
|
191
|
-
Copyright (c) 2009, Caricature Team
|
192
|
-
http://github.com/casualjim/caricature
|
193
|
-
All rights reserved.
|
194
|
-
|
195
|
-
Redistribution and use in source and binary forms,
|
196
|
-
with or without modification, are permitted provided
|
197
|
-
that the following conditions are met:
|
198
|
-
|
199
|
-
* Redistributions of source code must retain the
|
200
|
-
above copyright notice, this list of conditions and
|
201
|
-
the following disclaimer.
|
202
|
-
|
203
|
-
* Redistributions in binary form must reproduce
|
204
|
-
the above copyright notice, this list of conditions
|
205
|
-
and the following disclaimer in the documentation
|
206
|
-
and/or other materials provided with the distribution.
|
207
|
-
|
208
|
-
* Neither the name of the Caricature Team nor the
|
209
|
-
names of its contributors may be used to endorse
|
210
|
-
or promote products derived from this software
|
211
|
-
without specific prior written permission.
|
212
|
-
|
213
|
-
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
|
214
|
-
CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
|
215
|
-
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
216
|
-
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
217
|
-
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
218
|
-
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
219
|
-
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
220
|
-
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
221
|
-
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
222
|
-
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
223
|
-
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
224
|
-
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
225
|
-
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
226
|
-
SUCH DAMAGE.
|
227
|
-
|
228
|
-
[This is the BSD license, see
|
229
|
-
http://www.opensource.org/licenses/bsd-license.php]
|
230
|
-
</pre>
|
231
|
-
|
232
|
-
</div>
|
233
|
-
|
234
|
-
<div id="validator-badges">
|
235
|
-
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
236
|
-
<p><small>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish
|
237
|
-
Rdoc Generator</a> 1.1.6</small>.</p>
|
238
|
-
</div>
|
239
|
-
</body>
|
240
|
-
</html>
|
241
|
-
|