dfect 2.0.0 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/HISTORY +25 -4
- data/MANUAL +23 -0
- data/USAGE +303 -290
- data/bin/dfect +57 -0
- data/doc/api/Dfect.html +835 -544
- data/doc/api/Object.html +9 -5
- data/doc/api/_index.html +5 -5
- data/doc/api/class_list.html +1 -1
- data/doc/api/css/style.css +6 -1
- data/doc/api/file.LICENSE.html +4 -4
- data/doc/api/file_list.html +1 -1
- data/doc/api/frames.html +1 -1
- data/doc/api/index.html +4 -4
- data/doc/api/js/app.js +12 -0
- data/doc/api/js/full_list.js +11 -0
- data/doc/api/method_list.html +13 -5
- data/doc/api/top-level-namespace.html +5 -3
- data/doc/index.html +233 -137
- data/inochi.opts +31 -0
- data/lib/dfect.rb +2 -7
- data/lib/dfect/inochi.rb +83 -29
- data/test/dfect_test.rb +2 -0
- metadata +22 -11
- data/doc/index.erb +0 -18
- data/lib/dfect/inochi.yaml +0 -75
- data/test/dfect/inochi_test.rb +0 -17
data/bin/dfect
ADDED
@@ -0,0 +1,57 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
#
|
3
|
+
# Usage:
|
4
|
+
#
|
5
|
+
# dfect [Options] FILE_OR_GLOB...
|
6
|
+
#
|
7
|
+
# FILE_OR_GLOB : A file or file globbing pattern that
|
8
|
+
# describes a set of files to evaluate.
|
9
|
+
#
|
10
|
+
#
|
11
|
+
# Options:
|
12
|
+
#
|
13
|
+
# -d, --debug : Launch interactive debugger
|
14
|
+
# during assertion failures.
|
15
|
+
#
|
16
|
+
# -q, --quiet : Do not show execution report.
|
17
|
+
#
|
18
|
+
# -h, --help : Show this message and exit.
|
19
|
+
#
|
20
|
+
# -v, --version : Show version number and exit.
|
21
|
+
#
|
22
|
+
|
23
|
+
$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
|
24
|
+
require 'dfect'
|
25
|
+
|
26
|
+
# parse command line
|
27
|
+
if ARGV.delete('-h') or ARGV.delete('--help')
|
28
|
+
puts
|
29
|
+
puts Dfect.inspect
|
30
|
+
puts Dfect::TAGLINE
|
31
|
+
puts
|
32
|
+
puts
|
33
|
+
puts File.read(__FILE__)[/^#(\r?\n)(.*?)\1\1/m, 2].gsub(/^# ?/, '')
|
34
|
+
puts
|
35
|
+
puts
|
36
|
+
puts 'Read the user manual for more information:'
|
37
|
+
puts
|
38
|
+
puts " #{Dfect::INSTDIR}/doc/index.html"
|
39
|
+
puts
|
40
|
+
puts " #{Dfect::WEBSITE}"
|
41
|
+
puts
|
42
|
+
exit
|
43
|
+
elsif ARGV.delete('-v') or ARGV.delete('--version')
|
44
|
+
puts Dfect::VERSION
|
45
|
+
exit
|
46
|
+
end
|
47
|
+
|
48
|
+
if ARGV.delete('-d') or ARGV.delete('--debug')
|
49
|
+
Dfect.options[:debug] = true
|
50
|
+
end
|
51
|
+
|
52
|
+
if ARGV.delete('-q') or ARGV.delete('--quiet')
|
53
|
+
Dfect.options[:quiet] = true
|
54
|
+
end
|
55
|
+
|
56
|
+
require 'dfect/auto'
|
57
|
+
ARGV.each {|glob| Dir[glob].each {|test| load test } }
|
data/doc/api/Dfect.html
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
3
3
|
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
4
4
|
<head>
|
5
|
-
<meta name="Content-Type" content="text/html; charset=
|
5
|
+
<meta name="Content-Type" content="text/html; charset=utf-8" />
|
6
6
|
<title>Module: Dfect</title>
|
7
7
|
<link rel="stylesheet" href="css/style.css" type="text/css" media="screen" charset="utf-8" />
|
8
8
|
<link rel="stylesheet" href="css/common.css" type="text/css" media="screen" charset="utf-8" />
|
@@ -56,8 +56,13 @@
|
|
56
56
|
|
57
57
|
|
58
58
|
|
59
|
-
<dt class="r1
|
60
|
-
<dd class="r1
|
59
|
+
<dt class="r1">Included in:</dt>
|
60
|
+
<dd class="r1"><a href="Object.html" title="Object (class)">Object</a></dd>
|
61
|
+
|
62
|
+
|
63
|
+
|
64
|
+
<dt class="r2 last">Defined in:</dt>
|
65
|
+
<dd class="r2 last">lib/dfect.rb<span class="defines">,<br />
|
61
66
|
lib/dfect/mini.rb,<br /> lib/dfect/spec.rb,<br /> lib/dfect/unit.rb,<br /> lib/dfect/inochi.rb</span>
|
62
67
|
</dd>
|
63
68
|
|
@@ -70,19 +75,196 @@
|
|
70
75
|
<dl class="constants">
|
71
76
|
|
72
77
|
<dt id="D-constant" class="">D =
|
73
|
-
|
78
|
+
<div class="docstring">
|
79
|
+
<div class="discussion">
|
80
|
+
<p>
|
74
81
|
Allows before and after hooks to be specified via the following method
|
75
|
-
syntax when this module is mixed-in
|
82
|
+
syntax when this module is mixed-in:
|
83
|
+
</p>
|
84
|
+
<pre class="code">
|
85
|
+
<span class='const'>D</span> <span class='period'>.</span><span class='op'><<</span> <span class='lbrace'>{</span> <span class='id puts'>puts</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>before all nested tests</span><span class='tstring_end'>"</span></span> <span class='rbrace'>}</span>
|
86
|
+
<span class='const'>D</span> <span class='period'>.</span><span class='op'><</span> <span class='lbrace'>{</span> <span class='id puts'>puts</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>before each nested test</span><span class='tstring_end'>"</span></span> <span class='rbrace'>}</span>
|
87
|
+
<span class='const'>D</span> <span class='period'>.</span><span class='op'>></span> <span class='lbrace'>{</span> <span class='id puts'>puts</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>after each nested test</span><span class='tstring_end'>"</span></span> <span class='rbrace'>}</span>
|
88
|
+
<span class='const'>D</span> <span class='period'>.</span><span class='op'>>></span> <span class='lbrace'>{</span> <span class='id puts'>puts</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>after all nested tests</span><span class='tstring_end'>"</span></span> <span class='rbrace'>}</span>
|
89
|
+
</pre>
|
90
|
+
|
76
91
|
|
77
|
-
</
|
92
|
+
</div>
|
93
|
+
</div>
|
94
|
+
<div class="tags">
|
95
|
+
|
96
|
+
</div>
|
78
97
|
</dt>
|
79
98
|
<dd><pre class="code"><span class='kw'>self</span></pre></dd>
|
80
99
|
|
100
|
+
<dt id="PROJECT-constant" class="">PROJECT =
|
101
|
+
<div class="docstring">
|
102
|
+
<div class="discussion">
|
103
|
+
<p>
|
104
|
+
Official name of this project.
|
105
|
+
</p>
|
106
|
+
|
107
|
+
|
108
|
+
</div>
|
109
|
+
</div>
|
110
|
+
<div class="tags">
|
111
|
+
|
112
|
+
</div>
|
113
|
+
</dt>
|
114
|
+
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Dfect</span><span class='tstring_end'>"</span></span></pre></dd>
|
115
|
+
|
116
|
+
<dt id="TAGLINE-constant" class="">TAGLINE =
|
117
|
+
<div class="docstring">
|
118
|
+
<div class="discussion">
|
119
|
+
<p>
|
120
|
+
Short single-line description of this project.
|
121
|
+
</p>
|
122
|
+
|
123
|
+
|
124
|
+
</div>
|
125
|
+
</div>
|
126
|
+
<div class="tags">
|
127
|
+
|
128
|
+
</div>
|
129
|
+
</dt>
|
130
|
+
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Assertion testing library for Ruby</span><span class='tstring_end'>"</span></span></pre></dd>
|
131
|
+
|
132
|
+
<dt id="WEBSITE-constant" class="">WEBSITE =
|
133
|
+
<div class="docstring">
|
134
|
+
<div class="discussion">
|
135
|
+
<p>
|
136
|
+
Address of this project’s official home page.
|
137
|
+
</p>
|
138
|
+
|
139
|
+
|
140
|
+
</div>
|
141
|
+
</div>
|
142
|
+
<div class="tags">
|
143
|
+
|
144
|
+
</div>
|
145
|
+
</dt>
|
146
|
+
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>http://snk.tuxfamily.org/lib/dfect/</span><span class='tstring_end'>"</span></span></pre></dd>
|
147
|
+
|
148
|
+
<dt id="VERSION-constant" class="">VERSION =
|
149
|
+
<div class="docstring">
|
150
|
+
<div class="discussion">
|
151
|
+
<p>
|
152
|
+
Number of this release of this project.
|
153
|
+
</p>
|
154
|
+
|
155
|
+
|
156
|
+
</div>
|
157
|
+
</div>
|
158
|
+
<div class="tags">
|
159
|
+
|
160
|
+
</div>
|
161
|
+
</dt>
|
162
|
+
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>2.1.0</span><span class='tstring_end'>"</span></span></pre></dd>
|
163
|
+
|
164
|
+
<dt id="RELDATE-constant" class="">RELDATE =
|
165
|
+
<div class="docstring">
|
166
|
+
<div class="discussion">
|
167
|
+
<p>
|
168
|
+
Date of this release of this project.
|
169
|
+
</p>
|
170
|
+
|
171
|
+
|
172
|
+
</div>
|
173
|
+
</div>
|
174
|
+
<div class="tags">
|
175
|
+
|
176
|
+
</div>
|
177
|
+
</dt>
|
178
|
+
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>2010-03-31</span><span class='tstring_end'>"</span></span></pre></dd>
|
179
|
+
|
81
180
|
<dt id="INSTDIR-constant" class="">INSTDIR =
|
82
|
-
|
181
|
+
<div class="docstring">
|
182
|
+
<div class="discussion">
|
183
|
+
<p>
|
184
|
+
Location of this release of this project.
|
185
|
+
</p>
|
186
|
+
|
187
|
+
|
188
|
+
</div>
|
189
|
+
</div>
|
190
|
+
<div class="tags">
|
191
|
+
|
192
|
+
</div>
|
83
193
|
</dt>
|
84
194
|
<dd><pre class="code"><span class='const'>File</span><span class='period'>.</span><span class='id expand_path'>expand_path</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>../../..</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='kw'>__FILE__</span><span class='rparen'>)</span></pre></dd>
|
85
195
|
|
196
|
+
<dt id="RUNTIME-constant" class="">RUNTIME =
|
197
|
+
<div class="docstring">
|
198
|
+
<div class="discussion">
|
199
|
+
<p>
|
200
|
+
RubyGems required by this project during runtime.
|
201
|
+
</p>
|
202
|
+
|
203
|
+
|
204
|
+
</div>
|
205
|
+
</div>
|
206
|
+
<div class="tags">
|
207
|
+
|
208
|
+
<div class="examples">
|
209
|
+
<h3>Examples:</h3>
|
210
|
+
|
211
|
+
<h4><div class='inline'></div></h4>
|
212
|
+
<pre class="example code">
|
213
|
+
<span class='const'>RUNTIME</span> <span class='op'>=</span> <span class='lbrace'>{</span>
|
214
|
+
<span class='comment'># this project needs exactly version 1.2.3 of the "an_example" gem
|
215
|
+
</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>an_example</span><span class='tstring_end'>"</span></span> <span class='op'>=></span> <span class='lbracket'>[</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>1.2.3</span><span class='tstring_end'>"</span></span> <span class='rbracket'>]</span><span class='comma'>,</span>
|
216
|
+
|
217
|
+
<span class='comment'># this project needs at least version 1.2 (but not
|
218
|
+
</span> <span class='comment'># version 1.2.4 or newer) of the "another_example" gem
|
219
|
+
</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>another_example</span><span class='tstring_end'>"</span></span> <span class='op'>=></span> <span class='lbracket'>[</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>>= 1.2</span><span class='tstring_end'>"</span></span> <span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>< 1.2.4</span><span class='tstring_end'>"</span></span> <span class='rbracket'>]</span><span class='comma'>,</span>
|
220
|
+
|
221
|
+
<span class='comment'># this project needs any version of the "yet_another_example" gem
|
222
|
+
</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>yet_another_example</span><span class='tstring_end'>"</span></span> <span class='op'>=></span> <span class='lbracket'>[</span><span class='rbracket'>]</span><span class='comma'>,</span>
|
223
|
+
<span class='rbrace'>}</span></pre>
|
224
|
+
|
225
|
+
</div>
|
226
|
+
|
227
|
+
</div>
|
228
|
+
</dt>
|
229
|
+
<dd><pre class="code"><span class='lbrace'>{</span><span class='rbrace'>}</span></pre></dd>
|
230
|
+
|
231
|
+
<dt id="DEVTIME-constant" class="">DEVTIME =
|
232
|
+
<div class="docstring">
|
233
|
+
<div class="discussion">
|
234
|
+
<p>
|
235
|
+
RubyGems required by this project during development.
|
236
|
+
</p>
|
237
|
+
|
238
|
+
|
239
|
+
</div>
|
240
|
+
</div>
|
241
|
+
<div class="tags">
|
242
|
+
|
243
|
+
<div class="examples">
|
244
|
+
<h3>Examples:</h3>
|
245
|
+
|
246
|
+
<h4><div class='inline'></div></h4>
|
247
|
+
<pre class="example code">
|
248
|
+
<span class='const'>DEVTIME</span> <span class='op'>=</span> <span class='lbrace'>{</span>
|
249
|
+
<span class='comment'># this project needs exactly version 1.2.3 of the "an_example" gem
|
250
|
+
</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>an_example</span><span class='tstring_end'>"</span></span> <span class='op'>=></span> <span class='lbracket'>[</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>1.2.3</span><span class='tstring_end'>"</span></span> <span class='rbracket'>]</span><span class='comma'>,</span>
|
251
|
+
|
252
|
+
<span class='comment'># this project needs at least version 1.2 (but not
|
253
|
+
</span> <span class='comment'># version 1.2.4 or newer) of the "another_example" gem
|
254
|
+
</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>another_example</span><span class='tstring_end'>"</span></span> <span class='op'>=></span> <span class='lbracket'>[</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>>= 1.2</span><span class='tstring_end'>"</span></span> <span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>< 1.2.4</span><span class='tstring_end'>"</span></span> <span class='rbracket'>]</span><span class='comma'>,</span>
|
255
|
+
|
256
|
+
<span class='comment'># this project needs any version of the "yet_another_example" gem
|
257
|
+
</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>yet_another_example</span><span class='tstring_end'>"</span></span> <span class='op'>=></span> <span class='lbracket'>[</span><span class='rbracket'>]</span><span class='comma'>,</span>
|
258
|
+
<span class='rbrace'>}</span></pre>
|
259
|
+
|
260
|
+
</div>
|
261
|
+
|
262
|
+
</div>
|
263
|
+
</dt>
|
264
|
+
<dd><pre class="code"><span class='lbrace'>{</span>
|
265
|
+
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>inochi</span><span class='tstring_end'>"</span></span> <span class='op'>=></span> <span class='lbracket'>[</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>~> 2</span><span class='tstring_end'>"</span></span> <span class='rbracket'>]</span><span class='comma'>,</span> <span class='comment'># for managing this project
|
266
|
+
</span><span class='rbrace'>}</span></pre></dd>
|
267
|
+
|
86
268
|
</dl>
|
87
269
|
|
88
270
|
|
@@ -108,10 +290,10 @@ syntax when this module is mixed-in:.
|
|
108
290
|
|
109
291
|
|
110
292
|
|
111
|
-
<span class="summary_desc">
|
293
|
+
<span class="summary_desc"><div class='inline'><p>
|
112
294
|
Hash of choices that affect how Dfect operates.
|
113
|
-
|
114
|
-
</span>
|
295
|
+
</p>
|
296
|
+
</div></span>
|
115
297
|
|
116
298
|
</li>
|
117
299
|
|
@@ -134,10 +316,10 @@ Hash of choices that affect how Dfect operates.
|
|
134
316
|
|
135
317
|
|
136
318
|
|
137
|
-
<span class="summary_desc">
|
319
|
+
<span class="summary_desc"><div class='inline'><p>
|
138
320
|
Hash of test results, assembled by <tt><a href="#run-class_method" title="Dfect.run (method)">Dfect.run</a></tt>.
|
139
|
-
|
140
|
-
</span>
|
321
|
+
</p>
|
322
|
+
</div></span>
|
141
323
|
|
142
324
|
</li>
|
143
325
|
|
@@ -145,11 +327,12 @@ Hash of test results, assembled by <tt><a href="#run-class_method" title="Dfect.
|
|
145
327
|
</ul>
|
146
328
|
|
147
329
|
|
148
|
-
|
330
|
+
|
331
|
+
<h2>Class Method Summary</h2>
|
149
332
|
|
150
|
-
|
151
|
-
|
152
|
-
|
333
|
+
<ul class="summary">
|
334
|
+
|
335
|
+
<li class="public ">
|
153
336
|
<span class="summary_signature">
|
154
337
|
|
155
338
|
<a href="#%3C-class_method" title="< (class method)">+ (Object) <strong><</strong>(&block) </a>
|
@@ -164,16 +347,16 @@ Hash of test results, assembled by <tt><a href="#run-class_method" title="Dfect.
|
|
164
347
|
|
165
348
|
|
166
349
|
|
167
|
-
<span class="summary_desc">
|
350
|
+
<span class="summary_desc"><div class='inline'><p>
|
168
351
|
Registers the given block to be executed before each nested test inside
|
169
352
|
this test.
|
170
|
-
|
171
|
-
</span>
|
353
|
+
</p>
|
354
|
+
</div></span>
|
172
355
|
|
173
356
|
</li>
|
174
357
|
|
175
|
-
|
176
|
-
|
358
|
+
|
359
|
+
<li class="public ">
|
177
360
|
<span class="summary_signature">
|
178
361
|
|
179
362
|
<a href="#%3C%3C-class_method" title="<< (class method)">+ (Object) <strong><<</strong>(&block) </a>
|
@@ -188,16 +371,16 @@ this test.
|
|
188
371
|
|
189
372
|
|
190
373
|
|
191
|
-
<span class="summary_desc">
|
374
|
+
<span class="summary_desc"><div class='inline'><p>
|
192
375
|
Registers the given block to be executed before all nested tests inside
|
193
376
|
this test.
|
194
|
-
|
195
|
-
</span>
|
377
|
+
</p>
|
378
|
+
</div></span>
|
196
379
|
|
197
380
|
</li>
|
198
381
|
|
199
|
-
|
200
|
-
|
382
|
+
|
383
|
+
<li class="public ">
|
201
384
|
<span class="summary_signature">
|
202
385
|
|
203
386
|
<a href="#%3E-class_method" title="> (class method)">+ (Object) <strong>></strong>(&block) </a>
|
@@ -212,16 +395,16 @@ this test.
|
|
212
395
|
|
213
396
|
|
214
397
|
|
215
|
-
<span class="summary_desc">
|
398
|
+
<span class="summary_desc"><div class='inline'><p>
|
216
399
|
Registers the given block to be executed after each nested test inside this
|
217
400
|
test.
|
218
|
-
|
219
|
-
</span>
|
401
|
+
</p>
|
402
|
+
</div></span>
|
220
403
|
|
221
404
|
</li>
|
222
405
|
|
223
|
-
|
224
|
-
|
406
|
+
|
407
|
+
<li class="public ">
|
225
408
|
<span class="summary_signature">
|
226
409
|
|
227
410
|
<a href="#%3E%3E-class_method" title=">> (class method)">+ (Object) <strong>>></strong>(&block) </a>
|
@@ -236,16 +419,16 @@ test.
|
|
236
419
|
|
237
420
|
|
238
421
|
|
239
|
-
<span class="summary_desc">
|
422
|
+
<span class="summary_desc"><div class='inline'><p>
|
240
423
|
Registers the given block to be executed after all nested tests inside this
|
241
424
|
test.
|
242
|
-
|
243
|
-
</span>
|
425
|
+
</p>
|
426
|
+
</div></span>
|
244
427
|
|
245
428
|
</li>
|
246
429
|
|
247
|
-
|
248
|
-
|
430
|
+
|
431
|
+
<li class="public ">
|
249
432
|
<span class="summary_signature">
|
250
433
|
|
251
434
|
<a href="#C-class_method" title="C (class method)">+ (Object) <strong>C</strong>(symbol, message = nil, &block) </a>
|
@@ -260,15 +443,15 @@ test.
|
|
260
443
|
|
261
444
|
|
262
445
|
|
263
|
-
<span class="summary_desc">
|
446
|
+
<span class="summary_desc"><div class='inline'><p>
|
264
447
|
Asserts that the given symbol is thrown when the given block is executed.
|
265
|
-
|
266
|
-
</span>
|
448
|
+
</p>
|
449
|
+
</div></span>
|
267
450
|
|
268
451
|
</li>
|
269
452
|
|
270
|
-
|
271
|
-
|
453
|
+
|
454
|
+
<li class="public ">
|
272
455
|
<span class="summary_signature">
|
273
456
|
|
274
457
|
<a href="#C%21-class_method" title="C! (class method)">+ (Object) <strong>C!</strong>(symbol, message = nil, &block) </a>
|
@@ -283,16 +466,16 @@ Asserts that the given symbol is thrown when the given block is executed.
|
|
283
466
|
|
284
467
|
|
285
468
|
|
286
|
-
<span class="summary_desc">
|
469
|
+
<span class="summary_desc"><div class='inline'><p>
|
287
470
|
Asserts that the given symbol is not thrown when the given block is
|
288
471
|
executed.
|
289
|
-
|
290
|
-
</span>
|
472
|
+
</p>
|
473
|
+
</div></span>
|
291
474
|
|
292
475
|
</li>
|
293
476
|
|
294
|
-
|
295
|
-
|
477
|
+
|
478
|
+
<li class="public ">
|
296
479
|
<span class="summary_signature">
|
297
480
|
|
298
481
|
<a href="#C%3F-class_method" title="C? (class method)">+ (Boolean) <strong>C?</strong>(symbol, message = nil, &block) </a>
|
@@ -307,16 +490,16 @@ executed.
|
|
307
490
|
|
308
491
|
|
309
492
|
|
310
|
-
<span class="summary_desc">
|
493
|
+
<span class="summary_desc"><div class='inline'><p>
|
311
494
|
Returns true if the given symbol is thrown when the given block is
|
312
495
|
executed.
|
313
|
-
|
314
|
-
</span>
|
496
|
+
</p>
|
497
|
+
</div></span>
|
315
498
|
|
316
499
|
</li>
|
317
500
|
|
318
|
-
|
319
|
-
|
501
|
+
|
502
|
+
<li class="public ">
|
320
503
|
<span class="summary_signature">
|
321
504
|
|
322
505
|
<a href="#D-class_method" title="D (class method)">+ (Object) <strong>D</strong>(*description, &block) </a>
|
@@ -331,16 +514,16 @@ executed.
|
|
331
514
|
|
332
515
|
|
333
516
|
|
334
|
-
<span class="summary_desc">
|
517
|
+
<span class="summary_desc"><div class='inline'><p>
|
335
518
|
Defines a new test composed of the given description and the given block to
|
336
519
|
execute.
|
337
|
-
|
338
|
-
</span>
|
520
|
+
</p>
|
521
|
+
</div></span>
|
339
522
|
|
340
523
|
</li>
|
341
524
|
|
342
|
-
|
343
|
-
|
525
|
+
|
526
|
+
<li class="public ">
|
344
527
|
<span class="summary_signature">
|
345
528
|
|
346
529
|
<a href="#D%21-class_method" title="D! (class method)">+ (Object) <strong>D!</strong>(*description, &block) </a>
|
@@ -355,16 +538,16 @@ execute.
|
|
355
538
|
|
356
539
|
|
357
540
|
|
358
|
-
<span class="summary_desc">
|
541
|
+
<span class="summary_desc"><div class='inline'><p>
|
359
542
|
Defines a new test that is explicitly insulated from the tests that contain
|
360
543
|
it and also from the top-level Ruby environment.
|
361
|
-
|
362
|
-
</span>
|
544
|
+
</p>
|
545
|
+
</div></span>
|
363
546
|
|
364
547
|
</li>
|
365
548
|
|
366
|
-
|
367
|
-
|
549
|
+
|
550
|
+
<li class="public ">
|
368
551
|
<span class="summary_signature">
|
369
552
|
|
370
553
|
<a href="#E-class_method" title="E (class method)">+ (Object) <strong>E</strong>(*kinds_then_message, &block) </a>
|
@@ -379,16 +562,16 @@ it and also from the top-level Ruby environment.
|
|
379
562
|
|
380
563
|
|
381
564
|
|
382
|
-
<span class="summary_desc">
|
565
|
+
<span class="summary_desc"><div class='inline'><p>
|
383
566
|
Asserts that one of the given kinds of exceptions is raised when the given
|
384
567
|
block is executed.
|
385
|
-
|
386
|
-
</span>
|
568
|
+
</p>
|
569
|
+
</div></span>
|
387
570
|
|
388
571
|
</li>
|
389
572
|
|
390
|
-
|
391
|
-
|
573
|
+
|
574
|
+
<li class="public ">
|
392
575
|
<span class="summary_signature">
|
393
576
|
|
394
577
|
<a href="#E%21-class_method" title="E! (class method)">+ (Object) <strong>E!</strong>(*kinds_then_message, &block) </a>
|
@@ -403,16 +586,16 @@ block is executed.
|
|
403
586
|
|
404
587
|
|
405
588
|
|
406
|
-
<span class="summary_desc">
|
589
|
+
<span class="summary_desc"><div class='inline'><p>
|
407
590
|
Asserts that one of the given kinds of exceptions is not raised when the
|
408
591
|
given block is executed.
|
409
|
-
|
410
|
-
</span>
|
592
|
+
</p>
|
593
|
+
</div></span>
|
411
594
|
|
412
595
|
</li>
|
413
596
|
|
414
|
-
|
415
|
-
|
597
|
+
|
598
|
+
<li class="public ">
|
416
599
|
<span class="summary_signature">
|
417
600
|
|
418
601
|
<a href="#E%3F-class_method" title="E? (class method)">+ (Boolean) <strong>E?</strong>(*kinds_then_message, &block) </a>
|
@@ -427,16 +610,16 @@ given block is executed.
|
|
427
610
|
|
428
611
|
|
429
612
|
|
430
|
-
<span class="summary_desc">
|
613
|
+
<span class="summary_desc"><div class='inline'><p>
|
431
614
|
Returns true if one of the given kinds of exceptions is raised when the
|
432
615
|
given block is executed.
|
433
|
-
|
434
|
-
</span>
|
616
|
+
</p>
|
617
|
+
</div></span>
|
435
618
|
|
436
619
|
</li>
|
437
620
|
|
438
|
-
|
439
|
-
|
621
|
+
|
622
|
+
<li class="public ">
|
440
623
|
<span class="summary_signature">
|
441
624
|
|
442
625
|
<a href="#F%3F-class_method" title="F? (class method)">+ (Boolean) <strong>F?</strong>(message = nil, &block) </a>
|
@@ -451,15 +634,15 @@ given block is executed.
|
|
451
634
|
|
452
635
|
|
453
636
|
|
454
|
-
<span class="summary_desc">
|
637
|
+
<span class="summary_desc"><div class='inline'><p>
|
455
638
|
Returns true if the result of the given block is either nil or false.
|
456
|
-
|
457
|
-
</span>
|
639
|
+
</p>
|
640
|
+
</div></span>
|
458
641
|
|
459
642
|
</li>
|
460
643
|
|
461
|
-
|
462
|
-
|
644
|
+
|
645
|
+
<li class="public ">
|
463
646
|
<span class="summary_signature">
|
464
647
|
|
465
648
|
<a href="#info-class_method" title="info (class method)">+ (Object) <strong>info</strong> </a>
|
@@ -474,16 +657,16 @@ Returns true if the result of the given block is either nil or false.
|
|
474
657
|
|
475
658
|
|
476
659
|
|
477
|
-
<span class="summary_desc">
|
660
|
+
<span class="summary_desc"><div class='inline'><p>
|
478
661
|
Returns the details of the failure that is currently being debugged by the
|
479
662
|
user.
|
480
|
-
|
481
|
-
</span>
|
663
|
+
</p>
|
664
|
+
</div></span>
|
482
665
|
|
483
666
|
</li>
|
484
667
|
|
485
|
-
|
486
|
-
|
668
|
+
|
669
|
+
<li class="public ">
|
487
670
|
<span class="summary_signature">
|
488
671
|
|
489
672
|
<a href="#inspect-class_method" title="inspect (class method)">+ (Object) <strong>inspect</strong> </a>
|
@@ -498,12 +681,15 @@ user.
|
|
498
681
|
|
499
682
|
|
500
683
|
|
501
|
-
<span class="summary_desc"
|
684
|
+
<span class="summary_desc"><div class='inline'><p>
|
685
|
+
Description of this release of this project.
|
686
|
+
</p>
|
687
|
+
</div></span>
|
502
688
|
|
503
689
|
</li>
|
504
690
|
|
505
|
-
|
506
|
-
|
691
|
+
|
692
|
+
<li class="public ">
|
507
693
|
<span class="summary_signature">
|
508
694
|
|
509
695
|
<a href="#L-class_method" title="L (class method)">+ (Object) <strong>L</strong>(*messages) </a>
|
@@ -518,16 +704,41 @@ user.
|
|
518
704
|
|
519
705
|
|
520
706
|
|
521
|
-
<span class="summary_desc">
|
707
|
+
<span class="summary_desc"><div class='inline'><p>
|
522
708
|
Adds the given messages to the report inside the section of the currently
|
523
709
|
running test.
|
524
|
-
|
525
|
-
</span>
|
710
|
+
</p>
|
711
|
+
</div></span>
|
526
712
|
|
527
713
|
</li>
|
528
714
|
|
715
|
+
|
716
|
+
<li class="public ">
|
717
|
+
<span class="summary_signature">
|
529
718
|
|
530
|
-
<
|
719
|
+
<a href="#require-class_method" title="require (class method)">+ (Object) <strong>require</strong>(gem_name_or_library) </a>
|
720
|
+
|
721
|
+
|
722
|
+
|
723
|
+
</span>
|
724
|
+
|
725
|
+
|
726
|
+
|
727
|
+
|
728
|
+
|
729
|
+
|
730
|
+
|
731
|
+
<span class="summary_desc"><div class='inline'><p>
|
732
|
+
Loads the correct version (as defined by the <tt><a href="#RUNTIME-constant" title="Dfect::RUNTIME (constant)">RUNTIME</a></tt> or <tt><a href="#DEVTIME-constant" title="Dfect::DEVTIME (constant)">DEVTIME</a></tt>
|
733
|
+
constant in this module) of the given gem or the gem that contains the
|
734
|
+
given library.
|
735
|
+
</p>
|
736
|
+
</div></span>
|
737
|
+
|
738
|
+
</li>
|
739
|
+
|
740
|
+
|
741
|
+
<li class="public ">
|
531
742
|
<span class="summary_signature">
|
532
743
|
|
533
744
|
<a href="#run-class_method" title="run (class method)">+ (Object) <strong>run</strong>(continue = true) </a>
|
@@ -542,16 +753,16 @@ running test.
|
|
542
753
|
|
543
754
|
|
544
755
|
|
545
|
-
<span class="summary_desc">
|
756
|
+
<span class="summary_desc"><div class='inline'><p>
|
546
757
|
Executes all tests defined thus far and stores the results in
|
547
758
|
<tt><a href="#report-class_method" title="Dfect.report (method)">Dfect.report</a></tt>.
|
548
|
-
|
549
|
-
</span>
|
759
|
+
</p>
|
760
|
+
</div></span>
|
550
761
|
|
551
762
|
</li>
|
552
763
|
|
553
|
-
|
554
|
-
|
764
|
+
|
765
|
+
<li class="public ">
|
555
766
|
<span class="summary_signature">
|
556
767
|
|
557
768
|
<a href="#S-class_method" title="S (class method)">+ (Object) <strong>S</strong>(identifier, &block) </a>
|
@@ -566,15 +777,15 @@ Executes all tests defined thus far and stores the results in
|
|
566
777
|
|
567
778
|
|
568
779
|
|
569
|
-
<span class="summary_desc">
|
780
|
+
<span class="summary_desc"><div class='inline'><p>
|
570
781
|
Mechanism for sharing code between tests.
|
571
|
-
|
572
|
-
</span>
|
782
|
+
</p>
|
783
|
+
</div></span>
|
573
784
|
|
574
785
|
</li>
|
575
786
|
|
576
|
-
|
577
|
-
|
787
|
+
|
788
|
+
<li class="public ">
|
578
789
|
<span class="summary_signature">
|
579
790
|
|
580
791
|
<a href="#S%21-class_method" title="S! (class method)">+ (Object) <strong>S!</strong>(identifier, &block) </a>
|
@@ -589,17 +800,17 @@ Mechanism for sharing code between tests.
|
|
589
800
|
|
590
801
|
|
591
802
|
|
592
|
-
<span class="summary_desc">
|
803
|
+
<span class="summary_desc"><div class='inline'><p>
|
593
804
|
Shares the given code block under the given identifier and then immediately
|
594
805
|
injects that code block into the closest insulated Dfect test that contains
|
595
806
|
the call to this method.
|
596
|
-
|
597
|
-
</span>
|
807
|
+
</p>
|
808
|
+
</div></span>
|
598
809
|
|
599
810
|
</li>
|
600
811
|
|
601
|
-
|
602
|
-
|
812
|
+
|
813
|
+
<li class="public ">
|
603
814
|
<span class="summary_signature">
|
604
815
|
|
605
816
|
<a href="#S%3F-class_method" title="S? (class method)">+ (Boolean) <strong>S?</strong>(identifier) </a>
|
@@ -614,15 +825,15 @@ the call to this method.
|
|
614
825
|
|
615
826
|
|
616
827
|
|
617
|
-
<span class="summary_desc">
|
828
|
+
<span class="summary_desc"><div class='inline'><p>
|
618
829
|
Checks whether any code has been shared under the given identifier.
|
619
|
-
|
620
|
-
</span>
|
830
|
+
</p>
|
831
|
+
</div></span>
|
621
832
|
|
622
833
|
</li>
|
623
834
|
|
624
|
-
|
625
|
-
|
835
|
+
|
836
|
+
<li class="public ">
|
626
837
|
<span class="summary_signature">
|
627
838
|
|
628
839
|
<a href="#stop-class_method" title="stop (class method)">+ (Object) <strong>stop</strong> </a>
|
@@ -637,16 +848,16 @@ Checks whether any code has been shared under the given identifier.
|
|
637
848
|
|
638
849
|
|
639
850
|
|
640
|
-
<span class="summary_desc">
|
851
|
+
<span class="summary_desc"><div class='inline'><p>
|
641
852
|
Stops the execution of the <tt><a href="#run-class_method" title="Dfect.run (method)">Dfect.run</a></tt> method or raises an exception if
|
642
853
|
that method is not currently executing.
|
643
|
-
|
644
|
-
</span>
|
854
|
+
</p>
|
855
|
+
</div></span>
|
645
856
|
|
646
857
|
</li>
|
647
858
|
|
648
|
-
|
649
|
-
|
859
|
+
|
860
|
+
<li class="public ">
|
650
861
|
<span class="summary_signature">
|
651
862
|
|
652
863
|
<a href="#T-class_method" title="T (class method)">+ (Object) <strong>T</strong>(condition = nil, message = nil, &block) </a>
|
@@ -663,16 +874,16 @@ that method is not currently executing.
|
|
663
874
|
|
664
875
|
|
665
876
|
|
666
|
-
<span class="summary_desc">
|
877
|
+
<span class="summary_desc"><div class='inline'><p>
|
667
878
|
Asserts that the given condition or the result of the given block is
|
668
879
|
neither nil nor false and returns that result.
|
669
|
-
|
670
|
-
</span>
|
880
|
+
</p>
|
881
|
+
</div></span>
|
671
882
|
|
672
883
|
</li>
|
673
884
|
|
674
|
-
|
675
|
-
|
885
|
+
|
886
|
+
<li class="public ">
|
676
887
|
<span class="summary_signature">
|
677
888
|
|
678
889
|
<a href="#T%21-class_method" title="T! (class method)">+ (Object) <strong>T!</strong>(condition = nil, message = nil, &block) </a>
|
@@ -689,16 +900,16 @@ neither nil nor false and returns that result.
|
|
689
900
|
|
690
901
|
|
691
902
|
|
692
|
-
<span class="summary_desc">
|
903
|
+
<span class="summary_desc"><div class='inline'><p>
|
693
904
|
Asserts that the given condition or the result of the given block is either
|
694
905
|
nil or false and returns that result.
|
695
|
-
|
696
|
-
</span>
|
906
|
+
</p>
|
907
|
+
</div></span>
|
697
908
|
|
698
909
|
</li>
|
699
910
|
|
700
|
-
|
701
|
-
|
911
|
+
|
912
|
+
<li class="public ">
|
702
913
|
<span class="summary_signature">
|
703
914
|
|
704
915
|
<a href="#T%3F-class_method" title="T? (class method)">+ (Boolean) <strong>T?</strong>(condition = nil, message = nil, &block) </a>
|
@@ -713,22 +924,22 @@ nil or false and returns that result.
|
|
713
924
|
|
714
925
|
|
715
926
|
|
716
|
-
<span class="summary_desc">
|
927
|
+
<span class="summary_desc"><div class='inline'><p>
|
717
928
|
Returns true if the given condition or the result of the given block is
|
718
929
|
neither nil nor false.
|
719
|
-
|
720
|
-
</span>
|
930
|
+
</p>
|
931
|
+
</div></span>
|
721
932
|
|
722
933
|
</li>
|
723
934
|
|
724
|
-
|
725
|
-
|
726
|
-
|
727
|
-
|
935
|
+
|
936
|
+
</ul>
|
937
|
+
|
938
|
+
<h2>Instance Method Summary</h2>
|
728
939
|
|
729
|
-
|
730
|
-
|
731
|
-
|
940
|
+
<ul class="summary">
|
941
|
+
|
942
|
+
<li class="public ">
|
732
943
|
<span class="summary_signature">
|
733
944
|
|
734
945
|
<a href="#after-instance_method" title="#after (instance method)">- (Object) <strong>after</strong>(what, &block) </a>
|
@@ -743,12 +954,12 @@ neither nil nor false.
|
|
743
954
|
|
744
955
|
|
745
956
|
|
746
|
-
<span class="summary_desc"></span>
|
957
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
747
958
|
|
748
959
|
</li>
|
749
960
|
|
750
|
-
|
751
|
-
|
961
|
+
|
962
|
+
<li class="public ">
|
752
963
|
<span class="summary_signature">
|
753
964
|
|
754
965
|
<a href="#before-instance_method" title="#before (instance method)">- (Object) <strong>before</strong>(what, &block) </a>
|
@@ -763,12 +974,14 @@ neither nil nor false.
|
|
763
974
|
|
764
975
|
|
765
976
|
|
766
|
-
<span class="summary_desc"></span>
|
977
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
767
978
|
|
768
979
|
</li>
|
769
980
|
|
770
|
-
|
771
|
-
|
981
|
+
|
982
|
+
</ul>
|
983
|
+
|
984
|
+
|
772
985
|
|
773
986
|
<div id="class_attr_details" class="attr_details">
|
774
987
|
<h2>Class Attribute Details</h2>
|
@@ -815,12 +1028,12 @@ The default value is false.
|
|
815
1028
|
<pre class="lines">
|
816
1029
|
|
817
1030
|
|
818
|
-
|
819
|
-
|
820
|
-
|
1031
|
+
88
|
1032
|
+
89
|
1033
|
+
90</pre>
|
821
1034
|
</td>
|
822
1035
|
<td>
|
823
|
-
<pre class="code"><span class="info file"># File 'lib/dfect.rb', line
|
1036
|
+
<pre class="code"><span class="info file"># File 'lib/dfect.rb', line 88</span>
|
824
1037
|
|
825
1038
|
<span class='kw'>def</span> <span class='id options'>options</span>
|
826
1039
|
<span class='ivar'>@options</span>
|
@@ -898,12 +1111,12 @@ Assertion failures are represented as a Hash:
|
|
898
1111
|
<pre class="lines">
|
899
1112
|
|
900
1113
|
|
901
|
-
|
902
|
-
|
903
|
-
|
1114
|
+
70
|
1115
|
+
71
|
1116
|
+
72</pre>
|
904
1117
|
</td>
|
905
1118
|
<td>
|
906
|
-
<pre class="code"><span class="info file"># File 'lib/dfect.rb', line
|
1119
|
+
<pre class="code"><span class="info file"># File 'lib/dfect.rb', line 70</span>
|
907
1120
|
|
908
1121
|
<span class='kw'>def</span> <span class='id report'>report</span>
|
909
1122
|
<span class='ivar'>@report</span>
|
@@ -938,13 +1151,13 @@ Assertion failures are represented as a Hash:
|
|
938
1151
|
<div class="examples">
|
939
1152
|
<h3>Examples:</h3>
|
940
1153
|
|
941
|
-
<h4></h4>
|
1154
|
+
<h4><div class='inline'></div></h4>
|
942
1155
|
<pre class="example code">
|
943
|
-
|
1156
|
+
<span class='const'>D</span> <span class='period'>.</span><span class='op'><</span> <span class='lbrace'>{</span> <span class='id puts'>puts</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>before each nested test</span><span class='tstring_end'>"</span></span> <span class='rbrace'>}</span>
|
944
1157
|
|
945
|
-
|
946
|
-
|
947
|
-
|
1158
|
+
<span class='const'>D</span> <span class='period'>.</span><span class='op'><</span> <span class='kw'>do</span>
|
1159
|
+
<span class='id puts'>puts</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>before each nested test</span><span class='tstring_end'>"</span></span>
|
1160
|
+
<span class='kw'>end</span></pre>
|
948
1161
|
|
949
1162
|
</div>
|
950
1163
|
|
@@ -968,18 +1181,18 @@ this test.
|
|
968
1181
|
<pre class="lines">
|
969
1182
|
|
970
1183
|
|
1184
|
+
177
|
1185
|
+
178
|
1186
|
+
179
|
1187
|
+
180
|
1188
|
+
181
|
971
1189
|
182
|
972
1190
|
183
|
973
1191
|
184
|
974
|
-
185
|
975
|
-
186
|
976
|
-
187
|
977
|
-
188
|
978
|
-
189
|
979
|
-
190</pre>
|
1192
|
+
185</pre>
|
980
1193
|
</td>
|
981
1194
|
<td>
|
982
|
-
<pre class="code"><span class="info file"># File 'lib/dfect.rb', line
|
1195
|
+
<pre class="code"><span class="info file"># File 'lib/dfect.rb', line 177</span>
|
983
1196
|
|
984
1197
|
<span class='kw'>def</span> <span class='op'><</span><span class='lparen'>(</span><span class='op'>*</span><span class='id args'>args</span><span class='comma'>,</span> <span class='op'>&</span><span class='id block'>block</span><span class='rparen'>)</span>
|
985
1198
|
<span class='kw'>if</span> <span class='id args'>args</span><span class='period'>.</span><span class='id empty?'>empty?</span>
|
@@ -1017,13 +1230,13 @@ this test.
|
|
1017
1230
|
<div class="examples">
|
1018
1231
|
<h3>Examples:</h3>
|
1019
1232
|
|
1020
|
-
<h4></h4>
|
1233
|
+
<h4><div class='inline'></div></h4>
|
1021
1234
|
<pre class="example code">
|
1022
|
-
|
1235
|
+
<span class='const'>D</span> <span class='period'>.</span><span class='op'><<</span> <span class='lbrace'>{</span> <span class='id puts'>puts</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>before all nested tests</span><span class='tstring_end'>"</span></span> <span class='rbrace'>}</span>
|
1023
1236
|
|
1024
|
-
|
1025
|
-
|
1026
|
-
|
1237
|
+
<span class='const'>D</span> <span class='period'>.</span><span class='op'><<</span> <span class='kw'>do</span>
|
1238
|
+
<span class='id puts'>puts</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>before all nested tests</span><span class='tstring_end'>"</span></span>
|
1239
|
+
<span class='kw'>end</span></pre>
|
1027
1240
|
|
1028
1241
|
</div>
|
1029
1242
|
<h3>Raises:</h3>
|
@@ -1046,13 +1259,13 @@ this test.
|
|
1046
1259
|
<pre class="lines">
|
1047
1260
|
|
1048
1261
|
|
1049
|
-
|
1050
|
-
|
1051
|
-
|
1052
|
-
|
1262
|
+
216
|
1263
|
+
217
|
1264
|
+
218
|
1265
|
+
219</pre>
|
1053
1266
|
</td>
|
1054
1267
|
<td>
|
1055
|
-
<pre class="code"><span class="info file"># File 'lib/dfect.rb', line
|
1268
|
+
<pre class="code"><span class="info file"># File 'lib/dfect.rb', line 216</span>
|
1056
1269
|
|
1057
1270
|
<span class='kw'>def</span> <span class='op'><<</span> <span class='op'>&</span><span class='id block'>block</span>
|
1058
1271
|
<span class='id raise'>raise</span> <span class='const'>ArgumentError</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>block must be given</span><span class='tstring_end'>'</span></span> <span class='kw'>unless</span> <span class='id block'>block</span>
|
@@ -1085,13 +1298,13 @@ test.
|
|
1085
1298
|
<div class="examples">
|
1086
1299
|
<h3>Examples:</h3>
|
1087
1300
|
|
1088
|
-
<h4></h4>
|
1301
|
+
<h4><div class='inline'></div></h4>
|
1089
1302
|
<pre class="example code">
|
1090
|
-
|
1303
|
+
<span class='const'>D</span> <span class='period'>.</span><span class='op'>></span> <span class='lbrace'>{</span> <span class='id puts'>puts</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>after each nested test</span><span class='tstring_end'>"</span></span> <span class='rbrace'>}</span>
|
1091
1304
|
|
1092
|
-
|
1093
|
-
|
1094
|
-
|
1305
|
+
<span class='const'>D</span> <span class='period'>.</span><span class='op'>></span> <span class='kw'>do</span>
|
1306
|
+
<span class='id puts'>puts</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>after each nested test</span><span class='tstring_end'>"</span></span>
|
1307
|
+
<span class='kw'>end</span></pre>
|
1095
1308
|
|
1096
1309
|
</div>
|
1097
1310
|
<h3>Raises:</h3>
|
@@ -1114,13 +1327,13 @@ test.
|
|
1114
1327
|
<pre class="lines">
|
1115
1328
|
|
1116
1329
|
|
1117
|
-
|
1118
|
-
|
1119
|
-
|
1120
|
-
|
1330
|
+
199
|
1331
|
+
200
|
1332
|
+
201
|
1333
|
+
202</pre>
|
1121
1334
|
</td>
|
1122
1335
|
<td>
|
1123
|
-
<pre class="code"><span class="info file"># File 'lib/dfect.rb', line
|
1336
|
+
<pre class="code"><span class="info file"># File 'lib/dfect.rb', line 199</span>
|
1124
1337
|
|
1125
1338
|
<span class='kw'>def</span> <span class='op'>></span> <span class='op'>&</span><span class='id block'>block</span>
|
1126
1339
|
<span class='id raise'>raise</span> <span class='const'>ArgumentError</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>block must be given</span><span class='tstring_end'>'</span></span> <span class='kw'>unless</span> <span class='id block'>block</span>
|
@@ -1153,13 +1366,13 @@ test.
|
|
1153
1366
|
<div class="examples">
|
1154
1367
|
<h3>Examples:</h3>
|
1155
1368
|
|
1156
|
-
<h4></h4>
|
1369
|
+
<h4><div class='inline'></div></h4>
|
1157
1370
|
<pre class="example code">
|
1158
|
-
|
1371
|
+
<span class='const'>D</span> <span class='period'>.</span><span class='op'>>></span> <span class='lbrace'>{</span> <span class='id puts'>puts</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>after all nested tests</span><span class='tstring_end'>"</span></span> <span class='rbrace'>}</span>
|
1159
1372
|
|
1160
|
-
|
1161
|
-
|
1162
|
-
|
1373
|
+
<span class='const'>D</span> <span class='period'>.</span><span class='op'>>></span> <span class='kw'>do</span>
|
1374
|
+
<span class='id puts'>puts</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>after all nested tests</span><span class='tstring_end'>"</span></span>
|
1375
|
+
<span class='kw'>end</span></pre>
|
1163
1376
|
|
1164
1377
|
</div>
|
1165
1378
|
<h3>Raises:</h3>
|
@@ -1182,13 +1395,13 @@ test.
|
|
1182
1395
|
<pre class="lines">
|
1183
1396
|
|
1184
1397
|
|
1185
|
-
|
1186
|
-
|
1187
|
-
|
1188
|
-
|
1398
|
+
233
|
1399
|
+
234
|
1400
|
+
235
|
1401
|
+
236</pre>
|
1189
1402
|
</td>
|
1190
1403
|
<td>
|
1191
|
-
<pre class="code"><span class="info file"># File 'lib/dfect.rb', line
|
1404
|
+
<pre class="code"><span class="info file"># File 'lib/dfect.rb', line 233</span>
|
1192
1405
|
|
1193
1406
|
<span class='kw'>def</span> <span class='op'>>></span> <span class='op'>&</span><span class='id block'>block</span>
|
1194
1407
|
<span class='id raise'>raise</span> <span class='const'>ArgumentError</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>block must be given</span><span class='tstring_end'>'</span></span> <span class='kw'>unless</span> <span class='id block'>block</span>
|
@@ -1220,21 +1433,21 @@ Asserts that the given symbol is thrown when the given block is executed.
|
|
1220
1433
|
<div class="examples">
|
1221
1434
|
<h3>Examples:</h3>
|
1222
1435
|
|
1223
|
-
<h4>
|
1436
|
+
<h4><div class='inline'><p>
|
1224
1437
|
no message given
|
1225
|
-
|
1226
|
-
</h4>
|
1438
|
+
</p>
|
1439
|
+
</div></h4>
|
1227
1440
|
<pre class="example code">
|
1228
|
-
|
1229
|
-
</span
|
1230
|
-
</span
|
1441
|
+
<span class='const'>C</span><span class='lparen'>(</span><span class='symbol'>:foo</span><span class='rparen'>)</span> <span class='lbrace'>{</span> <span class='id throw'>throw</span> <span class='symbol'>:foo</span><span class='comma'>,</span> <span class='int'>123</span> <span class='rbrace'>}</span> <span class='comment'># passes, => 123
|
1442
|
+
</span><span class='const'>C</span><span class='lparen'>(</span><span class='symbol'>:foo</span><span class='rparen'>)</span> <span class='lbrace'>{</span> <span class='id throw'>throw</span> <span class='symbol'>:bar</span><span class='comma'>,</span> <span class='int'>456</span> <span class='rbrace'>}</span> <span class='comment'># fails, => 456
|
1443
|
+
</span><span class='const'>C</span><span class='lparen'>(</span><span class='symbol'>:foo</span><span class='rparen'>)</span> <span class='lbrace'>{</span> <span class='rbrace'>}</span> <span class='comment'># fails, => nil</span></pre>
|
1231
1444
|
|
1232
|
-
<h4>
|
1445
|
+
<h4><div class='inline'><p>
|
1233
1446
|
message is given
|
1234
|
-
|
1235
|
-
</h4>
|
1447
|
+
</p>
|
1448
|
+
</div></h4>
|
1236
1449
|
<pre class="example code">
|
1237
|
-
|
1450
|
+
<span class='const'>C</span><span class='lparen'>(</span><span class='symbol'>:foo</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>:foo must be thrown</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span> <span class='lbrace'>{</span> <span class='id throw'>throw</span> <span class='symbol'>:bar</span><span class='comma'>,</span> <span class='int'>789</span> <span class='rbrace'>}</span> <span class='comment'># fails, => nil</span></pre>
|
1238
1451
|
|
1239
1452
|
</div>
|
1240
1453
|
<h3>Parameters:</h3>
|
@@ -1250,10 +1463,10 @@ message is given
|
|
1250
1463
|
|
1251
1464
|
|
1252
1465
|
—
|
1253
|
-
|
1466
|
+
<div class='inline'><p>
|
1254
1467
|
Symbol that must be thrown by the given block.
|
1255
|
-
|
1256
|
-
|
1468
|
+
</p>
|
1469
|
+
</div>
|
1257
1470
|
|
1258
1471
|
</li>
|
1259
1472
|
|
@@ -1269,10 +1482,10 @@ Symbol that must be thrown by the given block.
|
|
1269
1482
|
|
1270
1483
|
|
1271
1484
|
—
|
1272
|
-
|
1485
|
+
<div class='inline'><p>
|
1273
1486
|
Optional message to show in the report if this assertion fails.
|
1274
|
-
|
1275
|
-
|
1487
|
+
</p>
|
1488
|
+
</div>
|
1276
1489
|
|
1277
1490
|
</li>
|
1278
1491
|
|
@@ -1288,14 +1501,14 @@ Optional message to show in the report if this assertion fails.
|
|
1288
1501
|
|
1289
1502
|
|
1290
1503
|
|
1291
|
-
|
1504
|
+
<div class='inline'><p>
|
1292
1505
|
If a value is thrown along with the expected symbol, then that value is
|
1293
1506
|
returned.
|
1294
|
-
|
1295
|
-
|
1507
|
+
</p>
|
1508
|
+
<p>
|
1296
1509
|
Otherwise, nil is returned.
|
1297
|
-
|
1298
|
-
|
1510
|
+
</p>
|
1511
|
+
</div>
|
1299
1512
|
|
1300
1513
|
</li>
|
1301
1514
|
|
@@ -1307,12 +1520,12 @@ Otherwise, nil is returned.
|
|
1307
1520
|
<pre class="lines">
|
1308
1521
|
|
1309
1522
|
|
1310
|
-
|
1311
|
-
|
1312
|
-
|
1523
|
+
469
|
1524
|
+
470
|
1525
|
+
471</pre>
|
1313
1526
|
</td>
|
1314
1527
|
<td>
|
1315
|
-
<pre class="code"><span class="info file"># File 'lib/dfect.rb', line
|
1528
|
+
<pre class="code"><span class="info file"># File 'lib/dfect.rb', line 469</span>
|
1316
1529
|
|
1317
1530
|
<span class='kw'>def</span> <span class='const'>C</span> <span class='id symbol'>symbol</span><span class='comma'>,</span> <span class='id message'>message</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='op'>&</span><span class='id block'>block</span>
|
1318
1531
|
<span class='id assert_catch'>assert_catch</span> <span class='symbol'>:assert</span><span class='comma'>,</span> <span class='id symbol'>symbol</span><span class='comma'>,</span> <span class='id message'>message</span><span class='comma'>,</span> <span class='op'>&</span><span class='id block'>block</span>
|
@@ -1344,21 +1557,21 @@ executed.
|
|
1344
1557
|
<div class="examples">
|
1345
1558
|
<h3>Examples:</h3>
|
1346
1559
|
|
1347
|
-
<h4>
|
1560
|
+
<h4><div class='inline'><p>
|
1348
1561
|
no message given
|
1349
|
-
|
1350
|
-
</h4>
|
1562
|
+
</p>
|
1563
|
+
</div></h4>
|
1351
1564
|
<pre class="example code">
|
1352
|
-
|
1353
|
-
</span
|
1354
|
-
</span
|
1565
|
+
<span class='id C!'>C!</span><span class='lparen'>(</span><span class='symbol'>:foo</span><span class='rparen'>)</span> <span class='lbrace'>{</span> <span class='id throw'>throw</span> <span class='symbol'>:foo</span><span class='comma'>,</span> <span class='int'>123</span> <span class='rbrace'>}</span> <span class='comment'># fails, => nil
|
1566
|
+
</span><span class='id C!'>C!</span><span class='lparen'>(</span><span class='symbol'>:foo</span><span class='rparen'>)</span> <span class='lbrace'>{</span> <span class='id throw'>throw</span> <span class='symbol'>:bar</span><span class='comma'>,</span> <span class='int'>456</span> <span class='rbrace'>}</span> <span class='comment'># passes, => nil
|
1567
|
+
</span><span class='id C!'>C!</span><span class='lparen'>(</span><span class='symbol'>:foo</span><span class='rparen'>)</span> <span class='lbrace'>{</span> <span class='rbrace'>}</span> <span class='comment'># passes, => nil</span></pre>
|
1355
1568
|
|
1356
|
-
<h4>
|
1569
|
+
<h4><div class='inline'><p>
|
1357
1570
|
message is given
|
1358
|
-
|
1359
|
-
</h4>
|
1571
|
+
</p>
|
1572
|
+
</div></h4>
|
1360
1573
|
<pre class="example code">
|
1361
|
-
|
1574
|
+
<span class='id C!'>C!</span><span class='lparen'>(</span><span class='symbol'>:foo</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>:foo must be thrown</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span> <span class='lbrace'>{</span> <span class='id throw'>throw</span> <span class='symbol'>:bar</span><span class='comma'>,</span> <span class='int'>789</span> <span class='rbrace'>}</span> <span class='comment'># passes, => nil</span></pre>
|
1362
1575
|
|
1363
1576
|
</div>
|
1364
1577
|
<h3>Parameters:</h3>
|
@@ -1374,10 +1587,10 @@ message is given
|
|
1374
1587
|
|
1375
1588
|
|
1376
1589
|
—
|
1377
|
-
|
1590
|
+
<div class='inline'><p>
|
1378
1591
|
Symbol that must not be thrown by the given block.
|
1379
|
-
|
1380
|
-
|
1592
|
+
</p>
|
1593
|
+
</div>
|
1381
1594
|
|
1382
1595
|
</li>
|
1383
1596
|
|
@@ -1393,10 +1606,10 @@ Symbol that must not be thrown by the given block.
|
|
1393
1606
|
|
1394
1607
|
|
1395
1608
|
—
|
1396
|
-
|
1609
|
+
<div class='inline'><p>
|
1397
1610
|
Optional message to show in the report if this assertion fails.
|
1398
|
-
|
1399
|
-
|
1611
|
+
</p>
|
1612
|
+
</div>
|
1400
1613
|
|
1401
1614
|
</li>
|
1402
1615
|
|
@@ -1412,10 +1625,10 @@ Optional message to show in the report if this assertion fails.
|
|
1412
1625
|
|
1413
1626
|
|
1414
1627
|
|
1415
|
-
|
1628
|
+
<div class='inline'><p>
|
1416
1629
|
nil, always.
|
1417
|
-
|
1418
|
-
|
1630
|
+
</p>
|
1631
|
+
</div>
|
1419
1632
|
|
1420
1633
|
</li>
|
1421
1634
|
|
@@ -1427,12 +1640,12 @@ nil, always.
|
|
1427
1640
|
<pre class="lines">
|
1428
1641
|
|
1429
1642
|
|
1430
|
-
|
1431
|
-
|
1432
|
-
|
1643
|
+
495
|
1644
|
+
496
|
1645
|
+
497</pre>
|
1433
1646
|
</td>
|
1434
1647
|
<td>
|
1435
|
-
<pre class="code"><span class="info file"># File 'lib/dfect.rb', line
|
1648
|
+
<pre class="code"><span class="info file"># File 'lib/dfect.rb', line 495</span>
|
1436
1649
|
|
1437
1650
|
<span class='kw'>def</span> <span class='id C!'>C!</span> <span class='id symbol'>symbol</span><span class='comma'>,</span> <span class='id message'>message</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='op'>&</span><span class='id block'>block</span>
|
1438
1651
|
<span class='id assert_catch'>assert_catch</span> <span class='symbol'>:negate</span><span class='comma'>,</span> <span class='id symbol'>symbol</span><span class='comma'>,</span> <span class='id message'>message</span><span class='comma'>,</span> <span class='op'>&</span><span class='id block'>block</span>
|
@@ -1464,21 +1677,21 @@ executed. Otherwise, returns false.
|
|
1464
1677
|
<div class="examples">
|
1465
1678
|
<h3>Examples:</h3>
|
1466
1679
|
|
1467
|
-
<h4>
|
1680
|
+
<h4><div class='inline'><p>
|
1468
1681
|
no message given
|
1469
|
-
|
1470
|
-
</h4>
|
1682
|
+
</p>
|
1683
|
+
</div></h4>
|
1471
1684
|
<pre class="example code">
|
1472
|
-
|
1473
|
-
</span
|
1474
|
-
</span
|
1685
|
+
<span class='id C?'>C?</span><span class='lparen'>(</span><span class='symbol'>:foo</span><span class='rparen'>)</span> <span class='lbrace'>{</span> <span class='id throw'>throw</span> <span class='symbol'>:foo</span><span class='comma'>,</span> <span class='int'>123</span> <span class='rbrace'>}</span> <span class='comment'># => true
|
1686
|
+
</span><span class='id C?'>C?</span><span class='lparen'>(</span><span class='symbol'>:foo</span><span class='rparen'>)</span> <span class='lbrace'>{</span> <span class='id throw'>throw</span> <span class='symbol'>:bar</span><span class='comma'>,</span> <span class='int'>456</span> <span class='rbrace'>}</span> <span class='comment'># => false
|
1687
|
+
</span><span class='id C?'>C?</span><span class='lparen'>(</span><span class='symbol'>:foo</span><span class='rparen'>)</span> <span class='lbrace'>{</span> <span class='rbrace'>}</span> <span class='comment'># => false</span></pre>
|
1475
1688
|
|
1476
|
-
<h4>
|
1689
|
+
<h4><div class='inline'><p>
|
1477
1690
|
message is given
|
1478
|
-
|
1479
|
-
</h4>
|
1691
|
+
</p>
|
1692
|
+
</div></h4>
|
1480
1693
|
<pre class="example code">
|
1481
|
-
|
1694
|
+
<span class='id C?'>C?</span><span class='lparen'>(</span><span class='symbol'>:foo</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>:foo must be thrown</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span> <span class='lbrace'>{</span> <span class='id throw'>throw</span> <span class='symbol'>:bar</span><span class='comma'>,</span> <span class='int'>789</span> <span class='rbrace'>}</span> <span class='comment'># => false</span></pre>
|
1482
1695
|
|
1483
1696
|
</div>
|
1484
1697
|
<h3>Parameters:</h3>
|
@@ -1494,10 +1707,10 @@ message is given
|
|
1494
1707
|
|
1495
1708
|
|
1496
1709
|
—
|
1497
|
-
|
1710
|
+
<div class='inline'><p>
|
1498
1711
|
Symbol that must be thrown by the given block.
|
1499
|
-
|
1500
|
-
|
1712
|
+
</p>
|
1713
|
+
</div>
|
1501
1714
|
|
1502
1715
|
</li>
|
1503
1716
|
|
@@ -1513,10 +1726,10 @@ Symbol that must be thrown by the given block.
|
|
1513
1726
|
|
1514
1727
|
|
1515
1728
|
—
|
1516
|
-
|
1729
|
+
<div class='inline'><p>
|
1517
1730
|
This parameter is optional and completely ignored.
|
1518
|
-
|
1519
|
-
|
1731
|
+
</p>
|
1732
|
+
</div>
|
1520
1733
|
|
1521
1734
|
</li>
|
1522
1735
|
|
@@ -1541,12 +1754,12 @@ This parameter is optional and completely ignored.
|
|
1541
1754
|
<pre class="lines">
|
1542
1755
|
|
1543
1756
|
|
1544
|
-
|
1545
|
-
|
1546
|
-
|
1757
|
+
517
|
1758
|
+
518
|
1759
|
+
519</pre>
|
1547
1760
|
</td>
|
1548
1761
|
<td>
|
1549
|
-
<pre class="code"><span class="info file"># File 'lib/dfect.rb', line
|
1762
|
+
<pre class="code"><span class="info file"># File 'lib/dfect.rb', line 517</span>
|
1550
1763
|
|
1551
1764
|
<span class='kw'>def</span> <span class='id C?'>C?</span> <span class='id symbol'>symbol</span><span class='comma'>,</span> <span class='id message'>message</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='op'>&</span><span class='id block'>block</span>
|
1552
1765
|
<span class='id assert_catch'>assert_catch</span> <span class='symbol'>:sample</span><span class='comma'>,</span> <span class='id symbol'>symbol</span><span class='comma'>,</span> <span class='id message'>message</span><span class='comma'>,</span> <span class='op'>&</span><span class='id block'>block</span>
|
@@ -1585,23 +1798,23 @@ top-level Ruby environment.
|
|
1585
1798
|
<div class="examples">
|
1586
1799
|
<h3>Examples:</h3>
|
1587
1800
|
|
1588
|
-
<h4></h4>
|
1801
|
+
<h4><div class='inline'></div></h4>
|
1589
1802
|
<pre class="example code">
|
1590
|
-
|
1591
|
-
|
1803
|
+
<span class='const'>D</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>a new array</span><span class='tstring_end'>"</span></span> <span class='kw'>do</span>
|
1804
|
+
<span class='const'>D</span> <span class='period'>.</span><span class='op'><</span> <span class='lbrace'>{</span> <span class='ivar'>@array</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span> <span class='rbrace'>}</span>
|
1592
1805
|
|
1593
|
-
|
1594
|
-
|
1595
|
-
|
1806
|
+
<span class='const'>D</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>must be empty</span><span class='tstring_end'>"</span></span> <span class='kw'>do</span>
|
1807
|
+
<span class='const'>T</span> <span class='lbrace'>{</span> <span class='ivar'>@array</span><span class='period'>.</span><span class='id empty?'>empty?</span> <span class='rbrace'>}</span>
|
1808
|
+
<span class='kw'>end</span>
|
1596
1809
|
|
1597
|
-
|
1598
|
-
|
1810
|
+
<span class='const'>D</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>when populated</span><span class='tstring_end'>"</span></span> <span class='kw'>do</span>
|
1811
|
+
<span class='const'>D</span> <span class='period'>.</span><span class='op'><</span> <span class='lbrace'>{</span> <span class='ivar'>@array</span><span class='period'>.</span><span class='id push'>push</span> <span class='int'>55</span> <span class='rbrace'>}</span>
|
1599
1812
|
|
1600
|
-
|
1601
|
-
|
1602
|
-
<span class='kw'>end</span>
|
1813
|
+
<span class='const'>D</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>must not be empty</span><span class='tstring_end'>"</span></span> <span class='kw'>do</span>
|
1814
|
+
<span class='const'>F</span> <span class='lbrace'>{</span> <span class='ivar'>@array</span><span class='period'>.</span><span class='id empty?'>empty?</span> <span class='rbrace'>}</span>
|
1603
1815
|
<span class='kw'>end</span>
|
1604
|
-
<span class='kw'>end</span
|
1816
|
+
<span class='kw'>end</span>
|
1817
|
+
<span class='kw'>end</span></pre>
|
1605
1818
|
|
1606
1819
|
</div>
|
1607
1820
|
<h3>Parameters:</h3>
|
@@ -1617,10 +1830,10 @@ top-level Ruby environment.
|
|
1617
1830
|
|
1618
1831
|
|
1619
1832
|
—
|
1620
|
-
|
1833
|
+
<div class='inline'><p>
|
1621
1834
|
A brief title or a series of objects that describe the test being defined.
|
1622
|
-
|
1623
|
-
|
1835
|
+
</p>
|
1836
|
+
</div>
|
1624
1837
|
|
1625
1838
|
</li>
|
1626
1839
|
|
@@ -1632,12 +1845,12 @@ A brief title or a series of objects that describe the test being defined.
|
|
1632
1845
|
<pre class="lines">
|
1633
1846
|
|
1634
1847
|
|
1635
|
-
|
1636
|
-
|
1637
|
-
|
1848
|
+
122
|
1849
|
+
123
|
1850
|
+
124</pre>
|
1638
1851
|
</td>
|
1639
1852
|
<td>
|
1640
|
-
<pre class="code"><span class="info file"># File 'lib/dfect.rb', line
|
1853
|
+
<pre class="code"><span class="info file"># File 'lib/dfect.rb', line 122</span>
|
1641
1854
|
|
1642
1855
|
<span class='kw'>def</span> <span class='const'>D</span> <span class='op'>*</span><span class='id description'>description</span><span class='comma'>,</span> <span class='op'>&</span><span class='id block'>block</span>
|
1643
1856
|
<span class='id create_test'>create_test</span> <span class='ivar'>@tests</span><span class='period'>.</span><span class='id empty?'>empty?</span><span class='comma'>,</span> <span class='op'>*</span><span class='id description'>description</span><span class='comma'>,</span> <span class='op'>&</span><span class='id block'>block</span>
|
@@ -1672,30 +1885,30 @@ This test may contain nested tests.
|
|
1672
1885
|
<div class="examples">
|
1673
1886
|
<h3>Examples:</h3>
|
1674
1887
|
|
1675
|
-
<h4></h4>
|
1888
|
+
<h4><div class='inline'></div></h4>
|
1676
1889
|
<pre class="example code">
|
1677
|
-
|
1678
|
-
|
1890
|
+
<span class='const'>D</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>a root-level test</span><span class='tstring_end'>"</span></span> <span class='kw'>do</span>
|
1891
|
+
<span class='ivar'>@outside</span> <span class='op'>=</span> <span class='int'>1</span>
|
1892
|
+
<span class='const'>T</span> <span class='lbrace'>{</span> <span class='kw'>defined?</span> <span class='ivar'>@outside</span> <span class='rbrace'>}</span>
|
1893
|
+
<span class='const'>T</span> <span class='lbrace'>{</span> <span class='ivar'>@outside</span> <span class='op'>==</span> <span class='int'>1</span> <span class='rbrace'>}</span>
|
1894
|
+
|
1895
|
+
<span class='const'>D</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>an inner, non-insulated test</span><span class='tstring_end'>"</span></span> <span class='kw'>do</span>
|
1679
1896
|
<span class='const'>T</span> <span class='lbrace'>{</span> <span class='kw'>defined?</span> <span class='ivar'>@outside</span> <span class='rbrace'>}</span>
|
1680
1897
|
<span class='const'>T</span> <span class='lbrace'>{</span> <span class='ivar'>@outside</span> <span class='op'>==</span> <span class='int'>1</span> <span class='rbrace'>}</span>
|
1898
|
+
<span class='kw'>end</span>
|
1681
1899
|
|
1682
|
-
|
1683
|
-
|
1684
|
-
|
1685
|
-
<span class='kw'>end</span>
|
1686
|
-
|
1687
|
-
<span class='id D!'>D!</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>an inner, insulated test</span><span class='tstring_end'>"</span></span> <span class='kw'>do</span>
|
1688
|
-
<span class='const'>F</span> <span class='lbrace'>{</span> <span class='kw'>defined?</span> <span class='ivar'>@outside</span> <span class='rbrace'>}</span>
|
1689
|
-
<span class='const'>F</span> <span class='lbrace'>{</span> <span class='ivar'>@outside</span> <span class='op'>==</span> <span class='int'>1</span> <span class='rbrace'>}</span>
|
1900
|
+
<span class='id D!'>D!</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>an inner, insulated test</span><span class='tstring_end'>"</span></span> <span class='kw'>do</span>
|
1901
|
+
<span class='const'>F</span> <span class='lbrace'>{</span> <span class='kw'>defined?</span> <span class='ivar'>@outside</span> <span class='rbrace'>}</span>
|
1902
|
+
<span class='const'>F</span> <span class='lbrace'>{</span> <span class='ivar'>@outside</span> <span class='op'>==</span> <span class='int'>1</span> <span class='rbrace'>}</span>
|
1690
1903
|
|
1691
|
-
|
1692
|
-
|
1693
|
-
|
1694
|
-
|
1904
|
+
<span class='ivar'>@inside</span> <span class='op'>=</span> <span class='int'>2</span>
|
1905
|
+
<span class='const'>T</span> <span class='lbrace'>{</span> <span class='kw'>defined?</span> <span class='ivar'>@inside</span> <span class='rbrace'>}</span>
|
1906
|
+
<span class='const'>T</span> <span class='lbrace'>{</span> <span class='ivar'>@inside</span> <span class='op'>==</span> <span class='int'>2</span> <span class='rbrace'>}</span>
|
1907
|
+
<span class='kw'>end</span>
|
1695
1908
|
|
1696
|
-
|
1697
|
-
|
1698
|
-
|
1909
|
+
<span class='const'>F</span> <span class='lbrace'>{</span> <span class='kw'>defined?</span> <span class='ivar'>@inside</span> <span class='rbrace'>}</span>
|
1910
|
+
<span class='const'>F</span> <span class='lbrace'>{</span> <span class='ivar'>@inside</span> <span class='op'>==</span> <span class='int'>2</span> <span class='rbrace'>}</span>
|
1911
|
+
<span class='kw'>end</span></pre>
|
1699
1912
|
|
1700
1913
|
</div>
|
1701
1914
|
<h3>Parameters:</h3>
|
@@ -1711,10 +1924,10 @@ This test may contain nested tests.
|
|
1711
1924
|
|
1712
1925
|
|
1713
1926
|
—
|
1714
|
-
|
1927
|
+
<div class='inline'><p>
|
1715
1928
|
A brief title or a series of objects that describe the test being defined.
|
1716
|
-
|
1717
|
-
|
1929
|
+
</p>
|
1930
|
+
</div>
|
1718
1931
|
|
1719
1932
|
</li>
|
1720
1933
|
|
@@ -1726,12 +1939,12 @@ A brief title or a series of objects that describe the test being defined.
|
|
1726
1939
|
<pre class="lines">
|
1727
1940
|
|
1728
1941
|
|
1729
|
-
|
1730
|
-
|
1731
|
-
|
1942
|
+
159
|
1943
|
+
160
|
1944
|
+
161</pre>
|
1732
1945
|
</td>
|
1733
1946
|
<td>
|
1734
|
-
<pre class="code"><span class="info file"># File 'lib/dfect.rb', line
|
1947
|
+
<pre class="code"><span class="info file"># File 'lib/dfect.rb', line 159</span>
|
1735
1948
|
|
1736
1949
|
<span class='kw'>def</span> <span class='id D!'>D!</span> <span class='op'>*</span><span class='id description'>description</span><span class='comma'>,</span> <span class='op'>&</span><span class='id block'>block</span>
|
1737
1950
|
<span class='id create_test'>create_test</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='op'>*</span><span class='id description'>description</span><span class='comma'>,</span> <span class='op'>&</span><span class='id block'>block</span>
|
@@ -1763,29 +1976,29 @@ block is executed.
|
|
1763
1976
|
<div class="examples">
|
1764
1977
|
<h3>Examples:</h3>
|
1765
1978
|
|
1766
|
-
<h4>
|
1979
|
+
<h4><div class='inline'><p>
|
1767
1980
|
no exceptions given
|
1768
|
-
|
1769
|
-
</h4>
|
1981
|
+
</p>
|
1982
|
+
</div></h4>
|
1770
1983
|
<pre class="example code">
|
1771
|
-
|
1772
|
-
</span
|
1984
|
+
<span class='const'>E</span> <span class='lbrace'>{</span> <span class='rbrace'>}</span> <span class='comment'># fails
|
1985
|
+
</span><span class='const'>E</span> <span class='lbrace'>{</span> <span class='id raise'>raise</span> <span class='rbrace'>}</span> <span class='comment'># passes</span></pre>
|
1773
1986
|
|
1774
|
-
<h4>
|
1987
|
+
<h4><div class='inline'><p>
|
1775
1988
|
single exception given
|
1776
|
-
|
1777
|
-
</h4>
|
1989
|
+
</p>
|
1990
|
+
</div></h4>
|
1778
1991
|
<pre class="example code">
|
1779
|
-
|
1780
|
-
|
1992
|
+
<span class='const'>E</span><span class='lparen'>(</span><span class='const'>ArgumentError</span><span class='rparen'>)</span> <span class='lbrace'>{</span> <span class='id raise'>raise</span> <span class='const'>ArgumentError</span> <span class='rbrace'>}</span>
|
1993
|
+
<span class='const'>E</span><span class='lparen'>(</span><span class='const'>ArgumentError</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>argument must be invalid</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span> <span class='lbrace'>{</span> <span class='id raise'>raise</span> <span class='const'>ArgumentError</span> <span class='rbrace'>}</span></pre>
|
1781
1994
|
|
1782
|
-
<h4>
|
1995
|
+
<h4><div class='inline'><p>
|
1783
1996
|
multiple exceptions given
|
1784
|
-
|
1785
|
-
</h4>
|
1997
|
+
</p>
|
1998
|
+
</div></h4>
|
1786
1999
|
<pre class="example code">
|
1787
|
-
|
1788
|
-
|
2000
|
+
<span class='const'>E</span><span class='lparen'>(</span><span class='const'>SyntaxError</span><span class='comma'>,</span> <span class='const'>NameError</span><span class='rparen'>)</span> <span class='lbrace'>{</span> <span class='id eval'>eval</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>...</span><span class='tstring_end'>"</span></span> <span class='rbrace'>}</span>
|
2001
|
+
<span class='const'>E</span><span class='lparen'>(</span><span class='const'>SyntaxError</span><span class='comma'>,</span> <span class='const'>NameError</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>string must compile</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span> <span class='lbrace'>{</span> <span class='id eval'>eval</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>...</span><span class='tstring_end'>"</span></span> <span class='rbrace'>}</span></pre>
|
1789
2002
|
|
1790
2003
|
</div>
|
1791
2004
|
<h3>Parameters:</h3>
|
@@ -1801,16 +2014,16 @@ multiple exceptions given
|
|
1801
2014
|
|
1802
2015
|
|
1803
2016
|
—
|
1804
|
-
|
2017
|
+
<div class='inline'><p>
|
1805
2018
|
Exception classes that must be raised by the given block, optionally
|
1806
2019
|
followed by a message to show in the report if this assertion fails.
|
1807
|
-
|
1808
|
-
|
2020
|
+
</p>
|
2021
|
+
<p>
|
1809
2022
|
If no exception classes are given, then StandardError is assumed (similar
|
1810
2023
|
to how a plain ‘rescue’ statement without any arguments catches
|
1811
2024
|
StandardError).
|
1812
|
-
|
1813
|
-
|
2025
|
+
</p>
|
2026
|
+
</div>
|
1814
2027
|
|
1815
2028
|
</li>
|
1816
2029
|
|
@@ -1826,13 +2039,13 @@ StandardError).
|
|
1826
2039
|
|
1827
2040
|
|
1828
2041
|
|
1829
|
-
|
2042
|
+
<div class='inline'><p>
|
1830
2043
|
If the block raises an exception, then that exception is returned.
|
1831
|
-
|
1832
|
-
|
2044
|
+
</p>
|
2045
|
+
<p>
|
1833
2046
|
Otherwise, nil is returned.
|
1834
|
-
|
1835
|
-
|
2047
|
+
</p>
|
2048
|
+
</div>
|
1836
2049
|
|
1837
2050
|
</li>
|
1838
2051
|
|
@@ -1844,12 +2057,12 @@ Otherwise, nil is returned.
|
|
1844
2057
|
<pre class="lines">
|
1845
2058
|
|
1846
2059
|
|
1847
|
-
|
1848
|
-
|
1849
|
-
|
2060
|
+
376
|
2061
|
+
377
|
2062
|
+
378</pre>
|
1850
2063
|
</td>
|
1851
2064
|
<td>
|
1852
|
-
<pre class="code"><span class="info file"># File 'lib/dfect.rb', line
|
2065
|
+
<pre class="code"><span class="info file"># File 'lib/dfect.rb', line 376</span>
|
1853
2066
|
|
1854
2067
|
<span class='kw'>def</span> <span class='const'>E</span> <span class='op'>*</span><span class='id kinds_then_message'>kinds_then_message</span><span class='comma'>,</span> <span class='op'>&</span><span class='id block'>block</span>
|
1855
2068
|
<span class='id assert_raise'>assert_raise</span> <span class='symbol'>:assert</span><span class='comma'>,</span> <span class='op'>*</span><span class='id kinds_then_message'>kinds_then_message</span><span class='comma'>,</span> <span class='op'>&</span><span class='id block'>block</span>
|
@@ -1881,29 +2094,29 @@ given block is executed.
|
|
1881
2094
|
<div class="examples">
|
1882
2095
|
<h3>Examples:</h3>
|
1883
2096
|
|
1884
|
-
<h4>
|
2097
|
+
<h4><div class='inline'><p>
|
1885
2098
|
no exceptions given
|
1886
|
-
|
1887
|
-
</h4>
|
2099
|
+
</p>
|
2100
|
+
</div></h4>
|
1888
2101
|
<pre class="example code">
|
1889
|
-
|
1890
|
-
</span
|
2102
|
+
<span class='id E!'>E!</span> <span class='lbrace'>{</span> <span class='rbrace'>}</span> <span class='comment'># passes
|
2103
|
+
</span><span class='id E!'>E!</span> <span class='lbrace'>{</span> <span class='id raise'>raise</span> <span class='rbrace'>}</span> <span class='comment'># fails</span></pre>
|
1891
2104
|
|
1892
|
-
<h4>
|
2105
|
+
<h4><div class='inline'><p>
|
1893
2106
|
single exception given
|
1894
|
-
|
1895
|
-
</h4>
|
2107
|
+
</p>
|
2108
|
+
</div></h4>
|
1896
2109
|
<pre class="example code">
|
1897
|
-
|
1898
|
-
</span
|
2110
|
+
<span class='id E!'>E!</span><span class='lparen'>(</span><span class='const'>ArgumentError</span><span class='rparen'>)</span> <span class='lbrace'>{</span> <span class='id raise'>raise</span> <span class='const'>ArgumentError</span> <span class='rbrace'>}</span> <span class='comment'># fails
|
2111
|
+
</span><span class='id E!'>E!</span><span class='lparen'>(</span><span class='const'>ArgumentError</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>argument must be invalid</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span> <span class='lbrace'>{</span> <span class='id raise'>raise</span> <span class='const'>ArgumentError</span> <span class='rbrace'>}</span></pre>
|
1899
2112
|
|
1900
|
-
<h4>
|
2113
|
+
<h4><div class='inline'><p>
|
1901
2114
|
multiple exceptions given
|
1902
|
-
|
1903
|
-
</h4>
|
2115
|
+
</p>
|
2116
|
+
</div></h4>
|
1904
2117
|
<pre class="example code">
|
1905
|
-
|
1906
|
-
|
2118
|
+
<span class='id E!'>E!</span><span class='lparen'>(</span><span class='const'>SyntaxError</span><span class='comma'>,</span> <span class='const'>NameError</span><span class='rparen'>)</span> <span class='lbrace'>{</span> <span class='id eval'>eval</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>...</span><span class='tstring_end'>"</span></span> <span class='rbrace'>}</span>
|
2119
|
+
<span class='id E!'>E!</span><span class='lparen'>(</span><span class='const'>SyntaxError</span><span class='comma'>,</span> <span class='const'>NameError</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>string must compile</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span> <span class='lbrace'>{</span> <span class='id eval'>eval</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>...</span><span class='tstring_end'>"</span></span> <span class='rbrace'>}</span></pre>
|
1907
2120
|
|
1908
2121
|
</div>
|
1909
2122
|
<h3>Parameters:</h3>
|
@@ -1919,16 +2132,16 @@ multiple exceptions given
|
|
1919
2132
|
|
1920
2133
|
|
1921
2134
|
—
|
1922
|
-
|
2135
|
+
<div class='inline'><p>
|
1923
2136
|
Exception classes that must be raised by the given block, optionally
|
1924
2137
|
followed by a message to show in the report if this assertion fails.
|
1925
|
-
|
1926
|
-
|
2138
|
+
</p>
|
2139
|
+
<p>
|
1927
2140
|
If no exception classes are given, then StandardError is assumed (similar
|
1928
2141
|
to how a plain ‘rescue’ statement without any arguments catches
|
1929
2142
|
StandardError).
|
1930
|
-
|
1931
|
-
|
2143
|
+
</p>
|
2144
|
+
</div>
|
1932
2145
|
|
1933
2146
|
</li>
|
1934
2147
|
|
@@ -1944,13 +2157,13 @@ StandardError).
|
|
1944
2157
|
|
1945
2158
|
|
1946
2159
|
|
1947
|
-
|
2160
|
+
<div class='inline'><p>
|
1948
2161
|
If the block raises an exception, then that exception is returned.
|
1949
|
-
|
1950
|
-
|
2162
|
+
</p>
|
2163
|
+
<p>
|
1951
2164
|
Otherwise, nil is returned.
|
1952
|
-
|
1953
|
-
|
2165
|
+
</p>
|
2166
|
+
</div>
|
1954
2167
|
|
1955
2168
|
</li>
|
1956
2169
|
|
@@ -1962,12 +2175,12 @@ Otherwise, nil is returned.
|
|
1962
2175
|
<pre class="lines">
|
1963
2176
|
|
1964
2177
|
|
1965
|
-
|
1966
|
-
|
1967
|
-
|
2178
|
+
403
|
2179
|
+
404
|
2180
|
+
405</pre>
|
1968
2181
|
</td>
|
1969
2182
|
<td>
|
1970
|
-
<pre class="code"><span class="info file"># File 'lib/dfect.rb', line
|
2183
|
+
<pre class="code"><span class="info file"># File 'lib/dfect.rb', line 403</span>
|
1971
2184
|
|
1972
2185
|
<span class='kw'>def</span> <span class='id E!'>E!</span> <span class='op'>*</span><span class='id kinds_then_message'>kinds_then_message</span><span class='comma'>,</span> <span class='op'>&</span><span class='id block'>block</span>
|
1973
2186
|
<span class='id assert_raise'>assert_raise</span> <span class='symbol'>:negate</span><span class='comma'>,</span> <span class='op'>*</span><span class='id kinds_then_message'>kinds_then_message</span><span class='comma'>,</span> <span class='op'>&</span><span class='id block'>block</span>
|
@@ -1999,28 +2212,28 @@ given block is executed. Otherwise, returns false.
|
|
1999
2212
|
<div class="examples">
|
2000
2213
|
<h3>Examples:</h3>
|
2001
2214
|
|
2002
|
-
<h4>
|
2215
|
+
<h4><div class='inline'><p>
|
2003
2216
|
no exceptions given
|
2004
|
-
|
2005
|
-
</h4>
|
2217
|
+
</p>
|
2218
|
+
</div></h4>
|
2006
2219
|
<pre class="example code">
|
2007
|
-
|
2008
|
-
</span
|
2220
|
+
<span class='id E?'>E?</span> <span class='lbrace'>{</span> <span class='rbrace'>}</span> <span class='comment'># => false
|
2221
|
+
</span><span class='id E?'>E?</span> <span class='lbrace'>{</span> <span class='id raise'>raise</span> <span class='rbrace'>}</span> <span class='comment'># => true</span></pre>
|
2009
2222
|
|
2010
|
-
<h4>
|
2223
|
+
<h4><div class='inline'><p>
|
2011
2224
|
single exception given
|
2012
|
-
|
2013
|
-
</h4>
|
2225
|
+
</p>
|
2226
|
+
</div></h4>
|
2014
2227
|
<pre class="example code">
|
2015
|
-
|
2228
|
+
<span class='id E?'>E?</span><span class='lparen'>(</span><span class='const'>ArgumentError</span><span class='rparen'>)</span> <span class='lbrace'>{</span> <span class='id raise'>raise</span> <span class='const'>ArgumentError</span> <span class='rbrace'>}</span> <span class='comment'># => true</span></pre>
|
2016
2229
|
|
2017
|
-
<h4>
|
2230
|
+
<h4><div class='inline'><p>
|
2018
2231
|
multiple exceptions given
|
2019
|
-
|
2020
|
-
</h4>
|
2232
|
+
</p>
|
2233
|
+
</div></h4>
|
2021
2234
|
<pre class="example code">
|
2022
|
-
|
2023
|
-
</span
|
2235
|
+
<span class='id E?'>E?</span><span class='lparen'>(</span><span class='const'>SyntaxError</span><span class='comma'>,</span> <span class='const'>NameError</span><span class='rparen'>)</span> <span class='lbrace'>{</span> <span class='id eval'>eval</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>...</span><span class='tstring_end'>"</span></span> <span class='rbrace'>}</span> <span class='comment'># => true
|
2236
|
+
</span><span class='id E!'>E!</span><span class='lparen'>(</span><span class='const'>SyntaxError</span><span class='comma'>,</span> <span class='const'>NameError</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>string must compile</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span> <span class='lbrace'>{</span> <span class='id eval'>eval</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>...</span><span class='tstring_end'>"</span></span> <span class='rbrace'>}</span></pre>
|
2024
2237
|
|
2025
2238
|
</div>
|
2026
2239
|
<h3>Parameters:</h3>
|
@@ -2036,16 +2249,16 @@ multiple exceptions given
|
|
2036
2249
|
|
2037
2250
|
|
2038
2251
|
—
|
2039
|
-
|
2252
|
+
<div class='inline'><p>
|
2040
2253
|
Exception classes that must be raised by the given block, optionally
|
2041
2254
|
followed by a message that is completely ignored.
|
2042
|
-
|
2043
|
-
|
2255
|
+
</p>
|
2256
|
+
<p>
|
2044
2257
|
If no exception classes are given, then StandardError is assumed (similar
|
2045
2258
|
to how a plain ‘rescue’ statement without any arguments catches
|
2046
2259
|
StandardError).
|
2047
|
-
|
2048
|
-
|
2260
|
+
</p>
|
2261
|
+
</div>
|
2049
2262
|
|
2050
2263
|
</li>
|
2051
2264
|
|
@@ -2070,12 +2283,12 @@ StandardError).
|
|
2070
2283
|
<pre class="lines">
|
2071
2284
|
|
2072
2285
|
|
2073
|
-
|
2074
|
-
|
2075
|
-
|
2286
|
+
437
|
2287
|
+
438
|
2288
|
+
439</pre>
|
2076
2289
|
</td>
|
2077
2290
|
<td>
|
2078
|
-
<pre class="code"><span class="info file"># File 'lib/dfect.rb', line
|
2291
|
+
<pre class="code"><span class="info file"># File 'lib/dfect.rb', line 437</span>
|
2079
2292
|
|
2080
2293
|
<span class='kw'>def</span> <span class='id E?'>E?</span> <span class='op'>*</span><span class='id kinds_then_message'>kinds_then_message</span><span class='comma'>,</span> <span class='op'>&</span><span class='id block'>block</span>
|
2081
2294
|
<span class='id assert_raise'>assert_raise</span> <span class='symbol'>:sample</span><span class='comma'>,</span> <span class='op'>*</span><span class='id kinds_then_message'>kinds_then_message</span><span class='comma'>,</span> <span class='op'>&</span><span class='id block'>block</span>
|
@@ -2107,21 +2320,21 @@ Otherwise, returns false.
|
|
2107
2320
|
<div class="examples">
|
2108
2321
|
<h3>Examples:</h3>
|
2109
2322
|
|
2110
|
-
<h4>
|
2323
|
+
<h4><div class='inline'><p>
|
2111
2324
|
no message given
|
2112
|
-
|
2113
|
-
</h4>
|
2325
|
+
</p>
|
2326
|
+
</div></h4>
|
2114
2327
|
<pre class="example code">
|
2115
|
-
|
2116
|
-
</span
|
2117
|
-
</span
|
2328
|
+
<span class='id F?'>F?</span> <span class='lbrace'>{</span> <span class='kw'>true</span> <span class='rbrace'>}</span> <span class='comment'># => false
|
2329
|
+
</span><span class='id F?'>F?</span> <span class='lbrace'>{</span> <span class='kw'>false</span> <span class='rbrace'>}</span> <span class='comment'># => true
|
2330
|
+
</span><span class='id F?'>F?</span> <span class='lbrace'>{</span> <span class='kw'>nil</span> <span class='rbrace'>}</span> <span class='comment'># => true</span></pre>
|
2118
2331
|
|
2119
|
-
<h4>
|
2332
|
+
<h4><div class='inline'><p>
|
2120
2333
|
message is given
|
2121
|
-
|
2122
|
-
</h4>
|
2334
|
+
</p>
|
2335
|
+
</div></h4>
|
2123
2336
|
<pre class="example code">
|
2124
|
-
|
2337
|
+
<span class='id F?'>F?</span><span class='lparen'>(</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>computers do not doublethink</span><span class='tstring_end'>"</span></span> <span class='rparen'>)</span> <span class='lbrace'>{</span> <span class='int'>2</span> <span class='op'>+</span> <span class='int'>2</span> <span class='op'>==</span> <span class='int'>5</span> <span class='rbrace'>}</span> <span class='comment'># => true</span></pre>
|
2125
2338
|
|
2126
2339
|
</div>
|
2127
2340
|
<h3>Parameters:</h3>
|
@@ -2139,10 +2352,10 @@ message is given
|
|
2139
2352
|
|
2140
2353
|
|
2141
2354
|
—
|
2142
|
-
|
2355
|
+
<div class='inline'><p>
|
2143
2356
|
This parameter is optional and completely ignored.
|
2144
|
-
|
2145
|
-
|
2357
|
+
</p>
|
2358
|
+
</div>
|
2146
2359
|
|
2147
2360
|
</li>
|
2148
2361
|
|
@@ -2167,12 +2380,12 @@ This parameter is optional and completely ignored.
|
|
2167
2380
|
<pre class="lines">
|
2168
2381
|
|
2169
2382
|
|
2170
|
-
|
2171
|
-
|
2172
|
-
|
2383
|
+
335
|
2384
|
+
336
|
2385
|
+
337</pre>
|
2173
2386
|
</td>
|
2174
2387
|
<td>
|
2175
|
-
<pre class="code"><span class="info file"># File 'lib/dfect.rb', line
|
2388
|
+
<pre class="code"><span class="info file"># File 'lib/dfect.rb', line 335</span>
|
2176
2389
|
|
2177
2390
|
<span class='kw'>def</span> <span class='id F?'>F?</span> <span class='id message'>message</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='op'>&</span><span class='id block'>block</span>
|
2178
2391
|
<span class='kw'>not</span> <span class='id T?'>T?</span> <span class='id message'>message</span><span class='comma'>,</span> <span class='op'>&</span><span class='id block'>block</span>
|
@@ -2207,12 +2420,12 @@ user.
|
|
2207
2420
|
<pre class="lines">
|
2208
2421
|
|
2209
2422
|
|
2210
|
-
|
2211
|
-
|
2212
|
-
|
2423
|
+
675
|
2424
|
+
676
|
2425
|
+
677</pre>
|
2213
2426
|
</td>
|
2214
2427
|
<td>
|
2215
|
-
<pre class="code"><span class="info file"># File 'lib/dfect.rb', line
|
2428
|
+
<pre class="code"><span class="info file"># File 'lib/dfect.rb', line 675</span>
|
2216
2429
|
|
2217
2430
|
<span class='kw'>def</span> <span class='id info'>info</span>
|
2218
2431
|
<span class='ivar'>@trace</span><span class='period'>.</span><span class='id last'>last</span>
|
@@ -2229,7 +2442,18 @@ user.
|
|
2229
2442
|
|
2230
2443
|
|
2231
2444
|
|
2232
|
-
</p><
|
2445
|
+
</p><div class="docstring">
|
2446
|
+
<div class="discussion">
|
2447
|
+
<p>
|
2448
|
+
Description of this release of this project.
|
2449
|
+
</p>
|
2450
|
+
|
2451
|
+
|
2452
|
+
</div>
|
2453
|
+
</div>
|
2454
|
+
<div class="tags">
|
2455
|
+
|
2456
|
+
</div><table class="source_code">
|
2233
2457
|
<tr>
|
2234
2458
|
<td>
|
2235
2459
|
<pre class="lines">
|
@@ -2243,7 +2467,7 @@ user.
|
|
2243
2467
|
<pre class="code"><span class="info file"># File 'lib/dfect/inochi.rb', line 31</span>
|
2244
2468
|
|
2245
2469
|
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id inspect'>inspect</span>
|
2246
|
-
<span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='const'>PROJECT</span><span class='rbrace'>}</span><span class='tstring_content'> </span><span class='embexpr_beg'>#{</span><span class='const'>VERSION</span><span class='rbrace'>}</span><span class='tstring_content'> (</span><span class='embexpr_beg'>#{</span><span class='const'>
|
2470
|
+
<span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='const'>PROJECT</span><span class='rbrace'>}</span><span class='tstring_content'> </span><span class='embexpr_beg'>#{</span><span class='const'>VERSION</span><span class='rbrace'>}</span><span class='tstring_content'> (</span><span class='embexpr_beg'>#{</span><span class='const'>RELDATE</span><span class='rbrace'>}</span><span class='tstring_content'>)</span><span class='tstring_end'>"</span></span>
|
2247
2471
|
<span class='kw'>end</span></pre>
|
2248
2472
|
</td>
|
2249
2473
|
</tr>
|
@@ -2275,19 +2499,19 @@ You can think of “L” as “to log something”.
|
|
2275
2499
|
<div class="examples">
|
2276
2500
|
<h3>Examples:</h3>
|
2277
2501
|
|
2278
|
-
<h4>
|
2502
|
+
<h4><div class='inline'><p>
|
2279
2503
|
single message given
|
2280
|
-
|
2281
|
-
</h4>
|
2504
|
+
</p>
|
2505
|
+
</div></h4>
|
2282
2506
|
<pre class="example code">
|
2283
|
-
|
2507
|
+
<span class='const'>L</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>establishing connection...</span><span class='tstring_end'>"</span></span></pre>
|
2284
2508
|
|
2285
|
-
<h4>
|
2509
|
+
<h4><div class='inline'><p>
|
2286
2510
|
multiple messages given
|
2287
|
-
|
2288
|
-
</h4>
|
2511
|
+
</p>
|
2512
|
+
</div></h4>
|
2289
2513
|
<pre class="example code">
|
2290
|
-
|
2514
|
+
<span class='const'>L</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>beginning calculation...</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='const'>Math</span><span class='op'>::</span><span class='const'>PI</span><span class='comma'>,</span> <span class='lbracket'>[</span><span class='int'>1</span><span class='comma'>,</span> <span class='int'>2</span><span class='comma'>,</span> <span class='int'>3</span><span class='comma'>,</span> <span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>a</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>b</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>c</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span><span class='rbracket'>]</span></pre>
|
2291
2515
|
|
2292
2516
|
</div>
|
2293
2517
|
<h3>Parameters:</h3>
|
@@ -2303,10 +2527,10 @@ multiple messages given
|
|
2303
2527
|
|
2304
2528
|
|
2305
2529
|
—
|
2306
|
-
|
2530
|
+
<div class='inline'><p>
|
2307
2531
|
Objects to be added to the report.
|
2308
|
-
|
2309
|
-
|
2532
|
+
</p>
|
2533
|
+
</div>
|
2310
2534
|
|
2311
2535
|
</li>
|
2312
2536
|
|
@@ -2318,12 +2542,12 @@ Objects to be added to the report.
|
|
2318
2542
|
<pre class="lines">
|
2319
2543
|
|
2320
2544
|
|
2321
|
-
|
2322
|
-
|
2323
|
-
|
2545
|
+
539
|
2546
|
+
540
|
2547
|
+
541</pre>
|
2324
2548
|
</td>
|
2325
2549
|
<td>
|
2326
|
-
<pre class="code"><span class="info file"># File 'lib/dfect.rb', line
|
2550
|
+
<pre class="code"><span class="info file"># File 'lib/dfect.rb', line 539</span>
|
2327
2551
|
|
2328
2552
|
<span class='kw'>def</span> <span class='const'>L</span> <span class='op'>*</span><span class='id messages'>messages</span>
|
2329
2553
|
<span class='ivar'>@trace</span><span class='period'>.</span><span class='id concat'>concat</span> <span class='id messages'>messages</span>
|
@@ -2331,6 +2555,73 @@ Objects to be added to the report.
|
|
2331
2555
|
</td>
|
2332
2556
|
</tr>
|
2333
2557
|
</table>
|
2558
|
+
</div>
|
2559
|
+
|
2560
|
+
<div class="method_details ">
|
2561
|
+
<p class="signature " id="require-class_method">
|
2562
|
+
|
2563
|
+
+ (<tt><a href="Object.html" title="Object (class)">Object</a></tt>) <strong>require</strong>(gem_name_or_library)
|
2564
|
+
|
2565
|
+
|
2566
|
+
|
2567
|
+
</p><div class="docstring">
|
2568
|
+
<div class="discussion">
|
2569
|
+
<p>
|
2570
|
+
Loads the correct version (as defined by the <tt><a href="#RUNTIME-constant" title="Dfect::RUNTIME (constant)">RUNTIME</a></tt> or <tt><a href="#DEVTIME-constant" title="Dfect::DEVTIME (constant)">DEVTIME</a></tt>
|
2571
|
+
constant in this module) of the given gem or the gem that contains the
|
2572
|
+
given library.
|
2573
|
+
</p>
|
2574
|
+
|
2575
|
+
|
2576
|
+
</div>
|
2577
|
+
</div>
|
2578
|
+
<div class="tags">
|
2579
|
+
|
2580
|
+
</div><table class="source_code">
|
2581
|
+
<tr>
|
2582
|
+
<td>
|
2583
|
+
<pre class="lines">
|
2584
|
+
|
2585
|
+
|
2586
|
+
85
|
2587
|
+
86
|
2588
|
+
87
|
2589
|
+
88
|
2590
|
+
89
|
2591
|
+
90
|
2592
|
+
91
|
2593
|
+
92
|
2594
|
+
93
|
2595
|
+
94
|
2596
|
+
95
|
2597
|
+
96
|
2598
|
+
97
|
2599
|
+
98
|
2600
|
+
99
|
2601
|
+
100</pre>
|
2602
|
+
</td>
|
2603
|
+
<td>
|
2604
|
+
<pre class="code"><span class="info file"># File 'lib/dfect/inochi.rb', line 85</span>
|
2605
|
+
|
2606
|
+
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id require'>require</span> <span class='id gem_name_or_library'>gem_name_or_library</span>
|
2607
|
+
<span class='comment'># prepare the correct version of the gem for loading
|
2608
|
+
</span> <span class='kw'>if</span> <span class='id respond_to?'>respond_to?</span> <span class='symbol'>:gem</span>
|
2609
|
+
<span class='id gem_name'>gem_name</span> <span class='op'>=</span> <span class='id gem_name_or_library'>gem_name_or_library</span><span class='period'>.</span><span class='id to_s'>to_s</span><span class='period'>.</span><span class='id sub'>sub</span><span class='lparen'>(</span><span class='tstring'><span class='regexp_beg'>%r{</span><span class='tstring_content'>/.*$</span><span class='regexp_end'>}</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
|
2610
|
+
<span class='kw'>if</span> <span class='id gem_version'>gem_version</span> <span class='op'>=</span> <span class='const'>RUNTIME</span><span class='lbracket'>[</span><span class='id gem_name'>gem_name</span><span class='rbracket'>]</span> <span class='op'>||</span> <span class='const'>DEVTIME</span><span class='lbracket'>[</span><span class='id gem_name'>gem_name</span><span class='rbracket'>]</span>
|
2611
|
+
<span class='kw'>begin</span>
|
2612
|
+
<span class='id gem'>gem</span> <span class='id gem_name'>gem_name</span><span class='comma'>,</span> <span class='op'>*</span><span class='id gem_version'>gem_version</span>
|
2613
|
+
<span class='kw'>rescue</span> <span class='const'>LoadError</span> <span class='op'>=></span> <span class='id error'>error</span>
|
2614
|
+
<span class='id warn'>warn</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='kw'>self</span><span class='period'>.</span><span class='id inspect'>inspect</span><span class='rbrace'>}</span><span class='tstring_content'>: </span><span class='embexpr_beg'>#{</span><span class='id error'>error</span><span class='rbrace'>}</span><span class='tstring_end'>"</span></span>
|
2615
|
+
<span class='kw'>end</span>
|
2616
|
+
<span class='kw'>end</span>
|
2617
|
+
<span class='kw'>end</span>
|
2618
|
+
|
2619
|
+
<span class='comment'># do the loading
|
2620
|
+
</span> <span class='kw'>super</span>
|
2621
|
+
<span class='kw'>end</span></pre>
|
2622
|
+
</td>
|
2623
|
+
</tr>
|
2624
|
+
</table>
|
2334
2625
|
</div>
|
2335
2626
|
|
2336
2627
|
<div class="method_details ">
|
@@ -2366,10 +2657,10 @@ Executes all tests defined thus far and stores the results in
|
|
2366
2657
|
|
2367
2658
|
|
2368
2659
|
—
|
2369
|
-
|
2660
|
+
<div class='inline'><p>
|
2370
2661
|
If true, results from previous executions will not be cleared.
|
2371
|
-
|
2372
|
-
|
2662
|
+
</p>
|
2663
|
+
</div>
|
2373
2664
|
|
2374
2665
|
</li>
|
2375
2666
|
|
@@ -2381,6 +2672,11 @@ If true, results from previous executions will not be cleared.
|
|
2381
2672
|
<pre class="lines">
|
2382
2673
|
|
2383
2674
|
|
2675
|
+
636
|
2676
|
+
637
|
2677
|
+
638
|
2678
|
+
639
|
2679
|
+
640
|
2384
2680
|
641
|
2385
2681
|
642
|
2386
2682
|
643
|
@@ -2401,15 +2697,10 @@ If true, results from previous executions will not be cleared.
|
|
2401
2697
|
658
|
2402
2698
|
659
|
2403
2699
|
660
|
2404
|
-
661
|
2405
|
-
662
|
2406
|
-
663
|
2407
|
-
664
|
2408
|
-
665
|
2409
|
-
666</pre>
|
2700
|
+
661</pre>
|
2410
2701
|
</td>
|
2411
2702
|
<td>
|
2412
|
-
<pre class="code"><span class="info file"># File 'lib/dfect.rb', line
|
2703
|
+
<pre class="code"><span class="info file"># File 'lib/dfect.rb', line 636</span>
|
2413
2704
|
|
2414
2705
|
<span class='kw'>def</span> <span class='id run'>run</span> <span class='id continue'>continue</span> <span class='op'>=</span> <span class='kw'>true</span>
|
2415
2706
|
<span class='comment'># clear previous results
|
@@ -2469,19 +2760,19 @@ this method.
|
|
2469
2760
|
<div class="examples">
|
2470
2761
|
<h3>Examples:</h3>
|
2471
2762
|
|
2472
|
-
<h4></h4>
|
2763
|
+
<h4><div class='inline'></div></h4>
|
2473
2764
|
<pre class="example code">
|
2474
|
-
|
2475
|
-
|
2476
|
-
</span
|
2765
|
+
<span class='const'>S</span> <span class='symbol'>:knowledge</span> <span class='kw'>do</span>
|
2766
|
+
<span class='comment'>#...
|
2767
|
+
</span><span class='kw'>end</span>
|
2477
2768
|
|
2478
|
-
|
2479
|
-
|
2480
|
-
|
2769
|
+
<span class='const'>D</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>some test</span><span class='tstring_end'>"</span></span> <span class='kw'>do</span>
|
2770
|
+
<span class='const'>S</span> <span class='symbol'>:knowledge</span>
|
2771
|
+
<span class='kw'>end</span>
|
2481
2772
|
|
2482
|
-
|
2483
|
-
|
2484
|
-
|
2773
|
+
<span class='const'>D</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>another test</span><span class='tstring_end'>"</span></span> <span class='kw'>do</span>
|
2774
|
+
<span class='const'>S</span> <span class='symbol'>:knowledge</span>
|
2775
|
+
<span class='kw'>end</span></pre>
|
2485
2776
|
|
2486
2777
|
</div>
|
2487
2778
|
<h3>Parameters:</h3>
|
@@ -2497,11 +2788,11 @@ this method.
|
|
2497
2788
|
|
2498
2789
|
|
2499
2790
|
—
|
2500
|
-
|
2791
|
+
<div class='inline'><p>
|
2501
2792
|
An object that identifies shared code. This must be common knowledge to all
|
2502
2793
|
parties that want to partake in the sharing.
|
2503
|
-
|
2504
|
-
|
2794
|
+
</p>
|
2795
|
+
</div>
|
2505
2796
|
|
2506
2797
|
</li>
|
2507
2798
|
|
@@ -2513,6 +2804,11 @@ parties that want to partake in the sharing.
|
|
2513
2804
|
<pre class="lines">
|
2514
2805
|
|
2515
2806
|
|
2807
|
+
572
|
2808
|
+
573
|
2809
|
+
574
|
2810
|
+
575
|
2811
|
+
576
|
2516
2812
|
577
|
2517
2813
|
578
|
2518
2814
|
579
|
@@ -2529,15 +2825,10 @@ parties that want to partake in the sharing.
|
|
2529
2825
|
590
|
2530
2826
|
591
|
2531
2827
|
592
|
2532
|
-
593
|
2533
|
-
594
|
2534
|
-
595
|
2535
|
-
596
|
2536
|
-
597
|
2537
|
-
598</pre>
|
2828
|
+
593</pre>
|
2538
2829
|
</td>
|
2539
2830
|
<td>
|
2540
|
-
<pre class="code"><span class="info file"># File 'lib/dfect.rb', line
|
2831
|
+
<pre class="code"><span class="info file"># File 'lib/dfect.rb', line 572</span>
|
2541
2832
|
|
2542
2833
|
<span class='kw'>def</span> <span class='const'>S</span> <span class='id identifier'>identifier</span><span class='comma'>,</span> <span class='op'>&</span><span class='id block'>block</span>
|
2543
2834
|
<span class='kw'>if</span> <span class='id block_given?'>block_given?</span>
|
@@ -2589,17 +2880,17 @@ the call to this method.
|
|
2589
2880
|
<div class="examples">
|
2590
2881
|
<h3>Examples:</h3>
|
2591
2882
|
|
2592
|
-
<h4></h4>
|
2883
|
+
<h4><div class='inline'></div></h4>
|
2593
2884
|
<pre class="example code">
|
2594
|
-
|
2595
|
-
|
2596
|
-
|
2597
|
-
</span>
|
2598
|
-
|
2885
|
+
<span class='const'>D</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>some test</span><span class='tstring_end'>"</span></span> <span class='kw'>do</span>
|
2886
|
+
<span class='id S!'>S!</span> <span class='symbol'>:knowledge</span> <span class='kw'>do</span>
|
2887
|
+
<span class='comment'>#...
|
2888
|
+
</span> <span class='kw'>end</span>
|
2889
|
+
<span class='kw'>end</span>
|
2599
2890
|
|
2600
|
-
|
2601
|
-
|
2602
|
-
|
2891
|
+
<span class='const'>D</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>another test</span><span class='tstring_end'>"</span></span> <span class='kw'>do</span>
|
2892
|
+
<span class='const'>S</span> <span class='symbol'>:knowledge</span>
|
2893
|
+
<span class='kw'>end</span></pre>
|
2603
2894
|
|
2604
2895
|
</div>
|
2605
2896
|
<h3>Parameters:</h3>
|
@@ -2615,11 +2906,11 @@ the call to this method.
|
|
2615
2906
|
|
2616
2907
|
|
2617
2908
|
—
|
2618
|
-
|
2909
|
+
<div class='inline'><p>
|
2619
2910
|
An object that identifies shared code. This must be common knowledge to all
|
2620
2911
|
parties that want to partake in the sharing.
|
2621
|
-
|
2622
|
-
|
2912
|
+
</p>
|
2913
|
+
</div>
|
2623
2914
|
|
2624
2915
|
</li>
|
2625
2916
|
|
@@ -2631,14 +2922,14 @@ parties that want to partake in the sharing.
|
|
2631
2922
|
<pre class="lines">
|
2632
2923
|
|
2633
2924
|
|
2634
|
-
|
2635
|
-
|
2636
|
-
|
2637
|
-
|
2638
|
-
|
2925
|
+
615
|
2926
|
+
616
|
2927
|
+
617
|
2928
|
+
618
|
2929
|
+
619</pre>
|
2639
2930
|
</td>
|
2640
2931
|
<td>
|
2641
|
-
<pre class="code"><span class="info file"># File 'lib/dfect.rb', line
|
2932
|
+
<pre class="code"><span class="info file"># File 'lib/dfect.rb', line 615</span>
|
2642
2933
|
|
2643
2934
|
<span class='kw'>def</span> <span class='id S!'>S!</span> <span class='id identifier'>identifier</span><span class='comma'>,</span> <span class='op'>&</span><span class='id block'>block</span>
|
2644
2935
|
<span class='id raise'>raise</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>block must be given</span><span class='tstring_end'>'</span></span> <span class='kw'>unless</span> <span class='id block_given?'>block_given?</span>
|
@@ -2687,12 +2978,12 @@ Checks whether any code has been shared under the given identifier.
|
|
2687
2978
|
<pre class="lines">
|
2688
2979
|
|
2689
2980
|
|
2690
|
-
|
2691
|
-
|
2692
|
-
|
2981
|
+
624
|
2982
|
+
625
|
2983
|
+
626</pre>
|
2693
2984
|
</td>
|
2694
2985
|
<td>
|
2695
|
-
<pre class="code"><span class="info file"># File 'lib/dfect.rb', line
|
2986
|
+
<pre class="code"><span class="info file"># File 'lib/dfect.rb', line 624</span>
|
2696
2987
|
|
2697
2988
|
<span class='kw'>def</span> <span class='id S?'>S?</span> <span class='id identifier'>identifier</span>
|
2698
2989
|
<span class='ivar'>@share</span><span class='period'>.</span><span class='id key?'>key?</span> <span class='id identifier'>identifier</span>
|
@@ -2727,12 +3018,12 @@ that method is not currently executing.
|
|
2727
3018
|
<pre class="lines">
|
2728
3019
|
|
2729
3020
|
|
2730
|
-
|
2731
|
-
|
2732
|
-
|
3021
|
+
667
|
3022
|
+
668
|
3023
|
+
669</pre>
|
2733
3024
|
</td>
|
2734
3025
|
<td>
|
2735
|
-
<pre class="code"><span class="info file"># File 'lib/dfect.rb', line
|
3026
|
+
<pre class="code"><span class="info file"># File 'lib/dfect.rb', line 667</span>
|
2736
3027
|
|
2737
3028
|
<span class='kw'>def</span> <span class='id stop'>stop</span>
|
2738
3029
|
<span class='id throw'>throw</span> <span class='symbol'>:stop_dfect_execution</span>
|
@@ -2768,21 +3059,21 @@ neither nil nor false and returns that result.
|
|
2768
3059
|
<div class="examples">
|
2769
3060
|
<h3>Examples:</h3>
|
2770
3061
|
|
2771
|
-
<h4>
|
3062
|
+
<h4><div class='inline'><p>
|
2772
3063
|
no message given
|
2773
|
-
|
2774
|
-
</h4>
|
3064
|
+
</p>
|
3065
|
+
</div></h4>
|
2775
3066
|
<pre class="example code">
|
2776
|
-
|
2777
|
-
</span
|
2778
|
-
</span
|
3067
|
+
<span class='const'>T</span> <span class='lbrace'>{</span> <span class='kw'>true</span> <span class='rbrace'>}</span> <span class='comment'># passes
|
3068
|
+
</span><span class='const'>T</span> <span class='lbrace'>{</span> <span class='kw'>false</span> <span class='rbrace'>}</span> <span class='comment'># fails
|
3069
|
+
</span><span class='const'>T</span> <span class='lbrace'>{</span> <span class='kw'>nil</span> <span class='rbrace'>}</span> <span class='comment'># fails</span></pre>
|
2779
3070
|
|
2780
|
-
<h4>
|
3071
|
+
<h4><div class='inline'><p>
|
2781
3072
|
message is given
|
2782
|
-
|
2783
|
-
</h4>
|
3073
|
+
</p>
|
3074
|
+
</div></h4>
|
2784
3075
|
<pre class="example code">
|
2785
|
-
|
3076
|
+
<span class='const'>T</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>computers do not doublethink</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span> <span class='lbrace'>{</span> <span class='int'>2</span> <span class='op'>+</span> <span class='int'>2</span> <span class='op'>!=</span> <span class='int'>5</span> <span class='rbrace'>}</span> <span class='comment'># passes</span></pre>
|
2786
3077
|
|
2787
3078
|
</div>
|
2788
3079
|
<h3>Parameters:</h3>
|
@@ -2800,11 +3091,11 @@ message is given
|
|
2800
3091
|
|
2801
3092
|
|
2802
3093
|
—
|
2803
|
-
|
3094
|
+
<div class='inline'><p>
|
2804
3095
|
The condition to be asserted. A block may be given in place of this
|
2805
3096
|
parameter.
|
2806
|
-
|
2807
|
-
|
3097
|
+
</p>
|
3098
|
+
</div>
|
2808
3099
|
|
2809
3100
|
</li>
|
2810
3101
|
|
@@ -2820,10 +3111,10 @@ parameter.
|
|
2820
3111
|
|
2821
3112
|
|
2822
3113
|
—
|
2823
|
-
|
3114
|
+
<div class='inline'><p>
|
2824
3115
|
Optional message to show in the report if this assertion fails.
|
2825
|
-
|
2826
|
-
|
3116
|
+
</p>
|
3117
|
+
</div>
|
2827
3118
|
|
2828
3119
|
</li>
|
2829
3120
|
|
@@ -2835,12 +3126,12 @@ Optional message to show in the report if this assertion fails.
|
|
2835
3126
|
<pre class="lines">
|
2836
3127
|
|
2837
3128
|
|
2838
|
-
|
2839
|
-
|
2840
|
-
|
3129
|
+
263
|
3130
|
+
264
|
3131
|
+
265</pre>
|
2841
3132
|
</td>
|
2842
3133
|
<td>
|
2843
|
-
<pre class="code"><span class="info file"># File 'lib/dfect.rb', line
|
3134
|
+
<pre class="code"><span class="info file"># File 'lib/dfect.rb', line 263</span>
|
2844
3135
|
|
2845
3136
|
<span class='kw'>def</span> <span class='const'>T</span> <span class='id condition'>condition</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='id message'>message</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='op'>&</span><span class='id block'>block</span>
|
2846
3137
|
<span class='id assert_yield'>assert_yield</span> <span class='symbol'>:assert</span><span class='comma'>,</span> <span class='id condition'>condition</span><span class='comma'>,</span> <span class='id message'>message</span><span class='comma'>,</span> <span class='op'>&</span><span class='id block'>block</span>
|
@@ -2876,21 +3167,21 @@ nil or false and returns that result.
|
|
2876
3167
|
<div class="examples">
|
2877
3168
|
<h3>Examples:</h3>
|
2878
3169
|
|
2879
|
-
<h4>
|
3170
|
+
<h4><div class='inline'><p>
|
2880
3171
|
no message given
|
2881
|
-
|
2882
|
-
</h4>
|
3172
|
+
</p>
|
3173
|
+
</div></h4>
|
2883
3174
|
<pre class="example code">
|
2884
|
-
|
2885
|
-
</span
|
2886
|
-
</span
|
3175
|
+
<span class='id T!'>T!</span> <span class='lbrace'>{</span> <span class='kw'>true</span> <span class='rbrace'>}</span> <span class='comment'># fails
|
3176
|
+
</span><span class='id T!'>T!</span> <span class='lbrace'>{</span> <span class='kw'>false</span> <span class='rbrace'>}</span> <span class='comment'># passes
|
3177
|
+
</span><span class='id T!'>T!</span> <span class='lbrace'>{</span> <span class='kw'>nil</span> <span class='rbrace'>}</span> <span class='comment'># passes</span></pre>
|
2887
3178
|
|
2888
|
-
<h4>
|
3179
|
+
<h4><div class='inline'><p>
|
2889
3180
|
message is given
|
2890
|
-
|
2891
|
-
</h4>
|
3181
|
+
</p>
|
3182
|
+
</div></h4>
|
2892
3183
|
<pre class="example code">
|
2893
|
-
|
3184
|
+
<span class='id T!'>T!</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>computers do not doublethink</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span> <span class='lbrace'>{</span> <span class='int'>2</span> <span class='op'>+</span> <span class='int'>2</span> <span class='op'>==</span> <span class='int'>5</span> <span class='rbrace'>}</span> <span class='comment'># passes</span></pre>
|
2894
3185
|
|
2895
3186
|
</div>
|
2896
3187
|
<h3>Parameters:</h3>
|
@@ -2908,11 +3199,11 @@ message is given
|
|
2908
3199
|
|
2909
3200
|
|
2910
3201
|
—
|
2911
|
-
|
3202
|
+
<div class='inline'><p>
|
2912
3203
|
The condition to be asserted. A block may be given in place of this
|
2913
3204
|
parameter.
|
2914
|
-
|
2915
|
-
|
3205
|
+
</p>
|
3206
|
+
</div>
|
2916
3207
|
|
2917
3208
|
</li>
|
2918
3209
|
|
@@ -2928,10 +3219,10 @@ parameter.
|
|
2928
3219
|
|
2929
3220
|
|
2930
3221
|
—
|
2931
|
-
|
3222
|
+
<div class='inline'><p>
|
2932
3223
|
Optional message to show in the report if this assertion fails.
|
2933
|
-
|
2934
|
-
|
3224
|
+
</p>
|
3225
|
+
</div>
|
2935
3226
|
|
2936
3227
|
</li>
|
2937
3228
|
|
@@ -2943,12 +3234,12 @@ Optional message to show in the report if this assertion fails.
|
|
2943
3234
|
<pre class="lines">
|
2944
3235
|
|
2945
3236
|
|
2946
|
-
|
2947
|
-
|
2948
|
-
|
3237
|
+
286
|
3238
|
+
287
|
3239
|
+
288</pre>
|
2949
3240
|
</td>
|
2950
3241
|
<td>
|
2951
|
-
<pre class="code"><span class="info file"># File 'lib/dfect.rb', line
|
3242
|
+
<pre class="code"><span class="info file"># File 'lib/dfect.rb', line 286</span>
|
2952
3243
|
|
2953
3244
|
<span class='kw'>def</span> <span class='id T!'>T!</span> <span class='id condition'>condition</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='id message'>message</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='op'>&</span><span class='id block'>block</span>
|
2954
3245
|
<span class='id assert_yield'>assert_yield</span> <span class='symbol'>:negate</span><span class='comma'>,</span> <span class='id condition'>condition</span><span class='comma'>,</span> <span class='id message'>message</span><span class='comma'>,</span> <span class='op'>&</span><span class='id block'>block</span>
|
@@ -2980,21 +3271,21 @@ neither nil nor false. Otherwise, returns false.
|
|
2980
3271
|
<div class="examples">
|
2981
3272
|
<h3>Examples:</h3>
|
2982
3273
|
|
2983
|
-
<h4>
|
3274
|
+
<h4><div class='inline'><p>
|
2984
3275
|
no message given
|
2985
|
-
|
2986
|
-
</h4>
|
3276
|
+
</p>
|
3277
|
+
</div></h4>
|
2987
3278
|
<pre class="example code">
|
2988
|
-
|
2989
|
-
</span
|
2990
|
-
</span
|
3279
|
+
<span class='id T?'>T?</span> <span class='lbrace'>{</span> <span class='kw'>true</span> <span class='rbrace'>}</span> <span class='comment'># => true
|
3280
|
+
</span><span class='id T?'>T?</span> <span class='lbrace'>{</span> <span class='kw'>false</span> <span class='rbrace'>}</span> <span class='comment'># => false
|
3281
|
+
</span><span class='id T?'>T?</span> <span class='lbrace'>{</span> <span class='kw'>nil</span> <span class='rbrace'>}</span> <span class='comment'># => false</span></pre>
|
2991
3282
|
|
2992
|
-
<h4>
|
3283
|
+
<h4><div class='inline'><p>
|
2993
3284
|
message is given
|
2994
|
-
|
2995
|
-
</h4>
|
3285
|
+
</p>
|
3286
|
+
</div></h4>
|
2996
3287
|
<pre class="example code">
|
2997
|
-
|
3288
|
+
<span class='id T?'>T?</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>computers do not doublethink</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span> <span class='lbrace'>{</span> <span class='int'>2</span> <span class='op'>+</span> <span class='int'>2</span> <span class='op'>!=</span> <span class='int'>5</span> <span class='rbrace'>}</span> <span class='comment'># => true</span></pre>
|
2998
3289
|
|
2999
3290
|
</div>
|
3000
3291
|
<h3>Parameters:</h3>
|
@@ -3012,10 +3303,10 @@ message is given
|
|
3012
3303
|
|
3013
3304
|
|
3014
3305
|
—
|
3015
|
-
|
3306
|
+
<div class='inline'><p>
|
3016
3307
|
This parameter is optional and completely ignored.
|
3017
|
-
|
3018
|
-
|
3308
|
+
</p>
|
3309
|
+
</div>
|
3019
3310
|
|
3020
3311
|
</li>
|
3021
3312
|
|
@@ -3031,11 +3322,11 @@ This parameter is optional and completely ignored.
|
|
3031
3322
|
|
3032
3323
|
|
3033
3324
|
—
|
3034
|
-
|
3325
|
+
<div class='inline'><p>
|
3035
3326
|
The condition to be asserted. A block may be given in place of this
|
3036
3327
|
parameter.
|
3037
|
-
|
3038
|
-
|
3328
|
+
</p>
|
3329
|
+
</div>
|
3039
3330
|
|
3040
3331
|
</li>
|
3041
3332
|
|
@@ -3060,12 +3351,12 @@ parameter.
|
|
3060
3351
|
<pre class="lines">
|
3061
3352
|
|
3062
3353
|
|
3063
|
-
|
3064
|
-
|
3065
|
-
|
3354
|
+
311
|
3355
|
+
312
|
3356
|
+
313</pre>
|
3066
3357
|
</td>
|
3067
3358
|
<td>
|
3068
|
-
<pre class="code"><span class="info file"># File 'lib/dfect.rb', line
|
3359
|
+
<pre class="code"><span class="info file"># File 'lib/dfect.rb', line 311</span>
|
3069
3360
|
|
3070
3361
|
<span class='kw'>def</span> <span class='id T?'>T?</span> <span class='id condition'>condition</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='id message'>message</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='op'>&</span><span class='id block'>block</span>
|
3071
3362
|
<span class='id assert_yield'>assert_yield</span> <span class='symbol'>:sample</span><span class='comma'>,</span> <span class='id condition'>condition</span><span class='comma'>,</span> <span class='id message'>message</span><span class='comma'>,</span> <span class='op'>&</span><span class='id block'>block</span>
|
@@ -3170,9 +3461,9 @@ parameter.
|
|
3170
3461
|
</div>
|
3171
3462
|
|
3172
3463
|
<div id="footer">
|
3173
|
-
Generated on
|
3464
|
+
Generated on Wed Mar 31 23:33:35 2010 by
|
3174
3465
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool">yard</a>
|
3175
|
-
0.5.
|
3466
|
+
0.5.4 (ruby-1.9.1).
|
3176
3467
|
</div>
|
3177
3468
|
|
3178
3469
|
</body>
|