dfect 0.0.0 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -58,7 +58,11 @@
58
58
  <dd>
59
59
  <ul>
60
60
 
61
- <li><a href="#M000008">C</a></li>
61
+ <li><a href="#M000012">C</a>,</li>
62
+
63
+ <li><a href="#M000013">C!</a>,</li>
64
+
65
+ <li><a href="#M000014">C?</a></li>
62
66
 
63
67
  </ul>
64
68
  </dd>
@@ -76,7 +80,11 @@
76
80
  <dd>
77
81
  <ul>
78
82
 
79
- <li><a href="#M000007">E</a></li>
83
+ <li><a href="#M000009">E</a>,</li>
84
+
85
+ <li><a href="#M000010">E!</a>,</li>
86
+
87
+ <li><a href="#M000011">E?</a></li>
80
88
 
81
89
  </ul>
82
90
  </dd>
@@ -85,7 +93,7 @@
85
93
  <dd>
86
94
  <ul>
87
95
 
88
- <li><a href="#M000006">F</a></li>
96
+ <li><a href="#M000008">F?</a></li>
89
97
 
90
98
  </ul>
91
99
  </dd>
@@ -94,7 +102,11 @@
94
102
  <dd>
95
103
  <ul>
96
104
 
97
- <li><a href="#M000005">T</a></li>
105
+ <li><a href="#M000005">T</a>,</li>
106
+
107
+ <li><a href="#M000006">T!</a>,</li>
108
+
109
+ <li><a href="#M000007">T?</a></li>
98
110
 
99
111
  </ul>
100
112
  </dd>
@@ -103,7 +115,7 @@
103
115
  <dd>
104
116
  <ul>
105
117
 
106
- <li><a href="#M000009">run</a></li>
118
+ <li><a href="#M000015">run</a></li>
107
119
 
108
120
  </ul>
109
121
  </dd>
@@ -112,7 +124,7 @@
112
124
  <dd>
113
125
  <ul>
114
126
 
115
- <li><a href="#M000010">stop</a></li>
127
+ <li><a href="#M000016">stop</a></li>
116
128
 
117
129
  </ul>
118
130
  </dd>
@@ -165,7 +177,7 @@ when this module is mixed-in:
165
177
  </td>
166
178
  <td class='attr-name'>report</td>
167
179
  <td class='attr-desc'><p>
168
- Hash of test results, assembled by <a href="Dfect.html#M000009">run</a>.
180
+ Hash of test results, assembled by <a href="Dfect.html#M000015">run</a>.
169
181
  </p>
170
182
  <dl>
171
183
  <dt>:execution</dt><dd>Hierarchical trace of all tests executed, where each test is represented by
@@ -241,12 +253,12 @@ The default value is false.
241
253
  <div class="method">
242
254
  <div class="title" id="M000001">
243
255
 
244
- <a name="M000001"></a><b>&lt;</b>(&amp;block)
256
+ <a name="M000001"></a><b> <(&block)
257
+ </b>
245
258
 
246
259
  </div>
247
260
 
248
261
  <div class="description">
249
-
250
262
  <p>
251
263
  Registers the given block to be executed before each nested test inside
252
264
  this test.
@@ -269,14 +281,19 @@ this test.
269
281
  <p class="source-link">
270
282
  Source: <a href="javascript:toggleSource('M000001_source')" id="l_M000001_source">show</a>
271
283
 
272
- | <a href="http://github.com/sunaku/dfect/blob/92165fb328974d547b1a9656a2ae92f9c84c96fb/lib/dfect.rb#L124" target="_blank" class="github_url">on GitHub</a>
284
+ | <a href="http://github.com/sunaku/dfect/blob/574a471b9687d6f0aac490200081f0dcd5db8a58/lib/dfect.rb#L138" target="_blank" class="github_url">on GitHub</a>
273
285
 
274
286
  </p>
275
287
  <div id="M000001_source" class="dyn-source">
276
- <pre><span class="ruby-comment cmt"># File lib/dfect.rb, line 124</span>
277
- <span class="ruby-keyword kw">def</span> <span class="ruby-operator">&lt;</span> <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>
278
- <span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-value str">'block must be given'</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">block</span>
279
- <span class="ruby-ivar">@curr_suite</span>.<span class="ruby-identifier">before_each</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">block</span>
288
+ <pre><span class="ruby-comment cmt"># File lib/dfect.rb, line 138</span>
289
+ <span class="ruby-keyword kw">def</span> <span class="ruby-operator">&lt;</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
290
+ <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">args</span>.<span class="ruby-identifier">empty?</span>
291
+ <span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-value str">'block must be given'</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">block</span>
292
+ <span class="ruby-ivar">@curr_suite</span>.<span class="ruby-identifier">before_each</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">block</span>
293
+ <span class="ruby-keyword kw">else</span>
294
+ <span class="ruby-comment cmt"># the &lt; method is being used as a check for inheritance</span>
295
+ <span class="ruby-keyword kw">super</span>
296
+ <span class="ruby-keyword kw">end</span>
280
297
  <span class="ruby-keyword kw">end</span></pre>
281
298
  </div>
282
299
  </div>
@@ -291,7 +308,6 @@ this test.
291
308
  </div>
292
309
 
293
310
  <div class="description">
294
-
295
311
  <p>
296
312
  Registers the given block to be executed before all nested tests inside
297
313
  this test.
@@ -314,11 +330,11 @@ this test.
314
330
  <p class="source-link">
315
331
  Source: <a href="javascript:toggleSource('M000003_source')" id="l_M000003_source">show</a>
316
332
 
317
- | <a href="http://github.com/sunaku/dfect/blob/92165fb328974d547b1a9656a2ae92f9c84c96fb/lib/dfect.rb#L158" target="_blank" class="github_url">on GitHub</a>
333
+ | <a href="http://github.com/sunaku/dfect/blob/574a471b9687d6f0aac490200081f0dcd5db8a58/lib/dfect.rb#L177" target="_blank" class="github_url">on GitHub</a>
318
334
 
319
335
  </p>
320
336
  <div id="M000003_source" class="dyn-source">
321
- <pre><span class="ruby-comment cmt"># File lib/dfect.rb, line 158</span>
337
+ <pre><span class="ruby-comment cmt"># File lib/dfect.rb, line 177</span>
322
338
  <span class="ruby-keyword kw">def</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>
323
339
  <span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-value str">'block must be given'</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">block</span>
324
340
  <span class="ruby-ivar">@curr_suite</span>.<span class="ruby-identifier">before_all</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">block</span>
@@ -336,7 +352,6 @@ this test.
336
352
  </div>
337
353
 
338
354
  <div class="description">
339
-
340
355
  <p>
341
356
  Registers the given block to be executed after each nested test inside this
342
357
  test.
@@ -359,11 +374,11 @@ test.
359
374
  <p class="source-link">
360
375
  Source: <a href="javascript:toggleSource('M000002_source')" id="l_M000002_source">show</a>
361
376
 
362
- | <a href="http://github.com/sunaku/dfect/blob/92165fb328974d547b1a9656a2ae92f9c84c96fb/lib/dfect.rb#L141" target="_blank" class="github_url">on GitHub</a>
377
+ | <a href="http://github.com/sunaku/dfect/blob/574a471b9687d6f0aac490200081f0dcd5db8a58/lib/dfect.rb#L160" target="_blank" class="github_url">on GitHub</a>
363
378
 
364
379
  </p>
365
380
  <div id="M000002_source" class="dyn-source">
366
- <pre><span class="ruby-comment cmt"># File lib/dfect.rb, line 141</span>
381
+ <pre><span class="ruby-comment cmt"># File lib/dfect.rb, line 160</span>
367
382
  <span class="ruby-keyword kw">def</span> <span class="ruby-operator">&gt;</span> <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>
368
383
  <span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-value str">'block must be given'</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">block</span>
369
384
  <span class="ruby-ivar">@curr_suite</span>.<span class="ruby-identifier">after_each</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">block</span>
@@ -381,7 +396,6 @@ test.
381
396
  </div>
382
397
 
383
398
  <div class="description">
384
-
385
399
  <p>
386
400
  Registers the given block to be executed after all nested tests inside this
387
401
  test.
@@ -404,11 +418,11 @@ test.
404
418
  <p class="source-link">
405
419
  Source: <a href="javascript:toggleSource('M000004_source')" id="l_M000004_source">show</a>
406
420
 
407
- | <a href="http://github.com/sunaku/dfect/blob/92165fb328974d547b1a9656a2ae92f9c84c96fb/lib/dfect.rb#L175" target="_blank" class="github_url">on GitHub</a>
421
+ | <a href="http://github.com/sunaku/dfect/blob/574a471b9687d6f0aac490200081f0dcd5db8a58/lib/dfect.rb#L194" target="_blank" class="github_url">on GitHub</a>
408
422
 
409
423
  </p>
410
424
  <div id="M000004_source" class="dyn-source">
411
- <pre><span class="ruby-comment cmt"># File lib/dfect.rb, line 175</span>
425
+ <pre><span class="ruby-comment cmt"># File lib/dfect.rb, line 194</span>
412
426
  <span class="ruby-keyword kw">def</span> <span class="ruby-operator">&gt;&gt;</span> <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>
413
427
  <span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-value str">'block must be given'</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">block</span>
414
428
  <span class="ruby-ivar">@curr_suite</span>.<span class="ruby-identifier">after_all</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">block</span>
@@ -419,17 +433,22 @@ test.
419
433
  </div>
420
434
 
421
435
  <div class="method">
422
- <div class="title" id="M000008">
436
+ <div class="title" id="M000012">
423
437
 
424
- <a name="M000008"></a><b>C</b>(message = nil, symbol = nil, &amp;block)
438
+ <a name="M000012"></a><b>C</b>(message = nil, symbol = nil, &amp;block)
425
439
 
426
440
  </div>
427
441
 
428
442
  <div class="description">
429
-
430
443
  <p>
431
- Asserts that the given symbol is thrown when the given block is executed,
432
- and returns the value that was thrown along with the symbol.
444
+ Asserts that the given symbol is thrown when the given block is executed.
445
+ </p>
446
+ <p>
447
+ If a value is thrown along with the expected symbol, then that value is
448
+ returned.
449
+ </p>
450
+ <p>
451
+ Otherwise, nil is returned.
433
452
  </p>
434
453
  <h4>Parameters</h4>
435
454
  <dl>
@@ -444,14 +463,13 @@ and returns the value that was thrown along with the symbol.
444
463
  <pre>
445
464
  # no message specified:
446
465
 
447
- C(:foo) { throw :foo } # passes
448
-
449
- C(:foo) { throw :bar } # fails
450
- C(:foo) { } # fails
466
+ C(:foo) { throw :foo, 123 } # passes, =&gt; 123
467
+ C(:foo) { throw :bar, 456 } # fails, =&gt; 456
468
+ C(:foo) { } # fails, =&gt; nil
451
469
 
452
470
  # message specified:
453
471
 
454
- C( &quot;:foo must be thrown&quot;, :foo ) { throw :bar } # fails
472
+ C( &quot;:foo must be thrown&quot;, :foo ) { throw :bar, 789 } # fails, =&gt; nil
455
473
  </pre>
456
474
 
457
475
  </div>
@@ -461,37 +479,130 @@ and returns the value that was thrown along with the symbol.
461
479
 
462
480
  <div class="sourcecode">
463
481
  <p class="source-link">
464
- Source: <a href="javascript:toggleSource('M000008_source')" id="l_M000008_source">show</a>
482
+ Source: <a href="javascript:toggleSource('M000012_source')" id="l_M000012_source">show</a>
465
483
 
466
- | <a href="http://github.com/sunaku/dfect/blob/92165fb328974d547b1a9656a2ae92f9c84c96fb/lib/dfect.rb#L342" target="_blank" class="github_url">on GitHub</a>
484
+ | <a href="http://github.com/sunaku/dfect/blob/574a471b9687d6f0aac490200081f0dcd5db8a58/lib/dfect.rb#L456" target="_blank" class="github_url">on GitHub</a>
467
485
 
468
486
  </p>
469
- <div id="M000008_source" class="dyn-source">
470
- <pre><span class="ruby-comment cmt"># File lib/dfect.rb, line 342</span>
487
+ <div id="M000012_source" class="dyn-source">
488
+ <pre><span class="ruby-comment cmt"># File lib/dfect.rb, line 456</span>
471
489
  <span class="ruby-keyword kw">def</span> <span class="ruby-constant">C</span> <span class="ruby-identifier">message</span> = <span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">symbol</span> = <span class="ruby-keyword kw">nil</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>
472
- <span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-value str">'block must be given'</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">block</span>
490
+ <span class="ruby-identifier">assert_catch</span> <span class="ruby-identifier">:assert</span>, <span class="ruby-identifier">message</span>, <span class="ruby-identifier">symbol</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>
491
+ <span class="ruby-keyword kw">end</span></pre>
492
+ </div>
493
+ </div>
494
+
495
+ </div>
496
+
497
+ <div class="method">
498
+ <div class="title" id="M000013">
499
+
500
+ <a name="M000013"></a><b>C!</b>(message = nil, symbol = nil, &amp;block)
501
+
502
+ </div>
503
+
504
+ <div class="description">
505
+ <p>
506
+ Asserts that the given symbol is not thrown when the given block is
507
+ executed.
508
+ </p>
509
+ <p>
510
+ Returns nil, always.
511
+ </p>
512
+ <h4>Parameters</h4>
513
+ <dl>
514
+ <dt>message</dt><dd>Optional message to show in the report if this assertion fails.
473
515
 
474
- <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">message</span>.<span class="ruby-identifier">is_a?</span> <span class="ruby-constant">Symbol</span> <span class="ruby-keyword kw">and</span> <span class="ruby-keyword kw">not</span> <span class="ruby-identifier">symbol</span>
475
- <span class="ruby-identifier">symbol</span> = <span class="ruby-identifier">message</span>
476
- <span class="ruby-identifier">message</span> = <span class="ruby-keyword kw">nil</span>
477
- <span class="ruby-keyword kw">end</span>
516
+ </dd>
517
+ <dt>symbol</dt><dd>Symbol that must not be thrown by the given block.
478
518
 
479
- <span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-value str">'symbol must be given'</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">symbol</span>
519
+ </dd>
520
+ </dl>
521
+ <h4>Examples</h4>
522
+ <pre>
523
+ # no message specified:
524
+
525
+ C!(:foo) { throw :foo, 123 } # fails, =&gt; nil
526
+ C!(:foo) { throw :bar, 456 } # passes, =&gt; nil
527
+ C!(:foo) { } # passes, =&gt; nil
480
528
 
481
- <span class="ruby-identifier">symbol</span> = <span class="ruby-identifier">symbol</span>.<span class="ruby-identifier">to_sym</span>
482
- <span class="ruby-identifier">message</span> <span class="ruby-operator">||=</span> <span class="ruby-node">&quot;block must throw #{symbol.inspect}&quot;</span>
529
+ # message specified:
483
530
 
484
- <span class="ruby-comment cmt"># if nothing was thrown, the result of catch()</span>
485
- <span class="ruby-comment cmt"># is simply the result of executing the block</span>
486
- <span class="ruby-identifier">result</span> = <span class="ruby-identifier">catch</span>(<span class="ruby-identifier">symbol</span>) { <span class="ruby-identifier">call</span> <span class="ruby-identifier">block</span>; <span class="ruby-keyword kw">self</span> }
531
+ C!( &quot;:foo must be thrown&quot;, :foo ) { throw :bar, 789 } # passes, =&gt; nil
532
+ </pre>
487
533
 
488
- <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">result</span> <span class="ruby-operator">==</span> <span class="ruby-keyword kw">self</span>
489
- <span class="ruby-ivar">@exec_stats</span>[<span class="ruby-identifier">:failed_assertions</span>] <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
490
- <span class="ruby-identifier">debug</span> <span class="ruby-identifier">block</span>, <span class="ruby-identifier">message</span>
491
- <span class="ruby-keyword kw">else</span>
492
- <span class="ruby-ivar">@exec_stats</span>[<span class="ruby-identifier">:passed_assertions</span>] <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
493
- <span class="ruby-identifier">result</span>
494
- <span class="ruby-keyword kw">end</span>
534
+ </div>
535
+
536
+
537
+
538
+
539
+ <div class="sourcecode">
540
+ <p class="source-link">
541
+ Source: <a href="javascript:toggleSource('M000013_source')" id="l_M000013_source">show</a>
542
+
543
+ | <a href="http://github.com/sunaku/dfect/blob/574a471b9687d6f0aac490200081f0dcd5db8a58/lib/dfect.rb#L487" target="_blank" class="github_url">on GitHub</a>
544
+
545
+ </p>
546
+ <div id="M000013_source" class="dyn-source">
547
+ <pre><span class="ruby-comment cmt"># File lib/dfect.rb, line 487</span>
548
+ <span class="ruby-keyword kw">def</span> <span class="ruby-constant">C!</span> <span class="ruby-identifier">message</span> = <span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">symbol</span> = <span class="ruby-keyword kw">nil</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>
549
+ <span class="ruby-identifier">assert_catch</span> <span class="ruby-identifier">:negate</span>, <span class="ruby-identifier">message</span>, <span class="ruby-identifier">symbol</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>
550
+ <span class="ruby-keyword kw">end</span></pre>
551
+ </div>
552
+ </div>
553
+
554
+ </div>
555
+
556
+ <div class="method">
557
+ <div class="title" id="M000014">
558
+
559
+ <a name="M000014"></a><b>C?</b>(message = nil, symbol = nil, &amp;block)
560
+
561
+ </div>
562
+
563
+ <div class="description">
564
+ <p>
565
+ Returns true if the given symbol is thrown when the given block is
566
+ executed. Otherwise, returns false.
567
+ </p>
568
+ <h4>Parameters</h4>
569
+ <dl>
570
+ <dt>message</dt><dd>This parameter is optional and completely ignored.
571
+
572
+ </dd>
573
+ <dt>symbol</dt><dd>Symbol that must be thrown by the given block.
574
+
575
+ </dd>
576
+ </dl>
577
+ <h4>Examples</h4>
578
+ <pre>
579
+ # no message specified:
580
+
581
+ C?(:foo) { throw :foo, 123 } # =&gt; true
582
+ C?(:foo) { throw :bar, 456 } # =&gt; false
583
+ C?(:foo) { } # =&gt; false
584
+
585
+ # message specified:
586
+
587
+ C?( &quot;:foo must be thrown&quot;, :foo ) { throw :bar, 789 } # =&gt; false
588
+ </pre>
589
+
590
+ </div>
591
+
592
+
593
+
594
+
595
+ <div class="sourcecode">
596
+ <p class="source-link">
597
+ Source: <a href="javascript:toggleSource('M000014_source')" id="l_M000014_source">show</a>
598
+
599
+ | <a href="http://github.com/sunaku/dfect/blob/574a471b9687d6f0aac490200081f0dcd5db8a58/lib/dfect.rb#L515" target="_blank" class="github_url">on GitHub</a>
600
+
601
+ </p>
602
+ <div id="M000014_source" class="dyn-source">
603
+ <pre><span class="ruby-comment cmt"># File lib/dfect.rb, line 515</span>
604
+ <span class="ruby-keyword kw">def</span> <span class="ruby-constant">C?</span> <span class="ruby-identifier">message</span> = <span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">symbol</span> = <span class="ruby-keyword kw">nil</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>
605
+ <span class="ruby-identifier">assert_catch</span> <span class="ruby-identifier">:sample</span>, <span class="ruby-identifier">message</span>, <span class="ruby-identifier">symbol</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>
495
606
  <span class="ruby-keyword kw">end</span></pre>
496
607
  </div>
497
608
  </div>
@@ -506,7 +617,6 @@ and returns the value that was thrown along with the symbol.
506
617
  </div>
507
618
 
508
619
  <div class="description">
509
-
510
620
  <p>
511
621
  Defines a new test, composed of the given description and the given block
512
622
  to execute.
@@ -548,11 +658,11 @@ A test may contain nested tests.
548
658
  <p class="source-link">
549
659
  Source: <a href="javascript:toggleSource('M000000_source')" id="l_M000000_source">show</a>
550
660
 
551
- | <a href="http://github.com/sunaku/dfect/blob/92165fb328974d547b1a9656a2ae92f9c84c96fb/lib/dfect.rb#L107" target="_blank" class="github_url">on GitHub</a>
661
+ | <a href="http://github.com/sunaku/dfect/blob/574a471b9687d6f0aac490200081f0dcd5db8a58/lib/dfect.rb#L119" target="_blank" class="github_url">on GitHub</a>
552
662
 
553
663
  </p>
554
664
  <div id="M000000_source" class="dyn-source">
555
- <pre><span class="ruby-comment cmt"># File lib/dfect.rb, line 107</span>
665
+ <pre><span class="ruby-comment cmt"># File lib/dfect.rb, line 119</span>
556
666
  <span class="ruby-keyword kw">def</span> <span class="ruby-constant">D</span> <span class="ruby-identifier">description</span> = <span class="ruby-identifier">caller</span>.<span class="ruby-identifier">first</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>
557
667
  <span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-value str">'block must be given'</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">block</span>
558
668
  <span class="ruby-ivar">@curr_suite</span>.<span class="ruby-identifier">tests</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-constant">Suite</span><span class="ruby-operator">::</span><span class="ruby-constant">Test</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">description</span>.<span class="ruby-identifier">to_s</span>, <span class="ruby-identifier">block</span>)
@@ -563,17 +673,22 @@ A test may contain nested tests.
563
673
  </div>
564
674
 
565
675
  <div class="method">
566
- <div class="title" id="M000007">
676
+ <div class="title" id="M000009">
567
677
 
568
- <a name="M000007"></a><b>E</b>(message = nil, *kinds, &amp;block)
678
+ <a name="M000009"></a><b>E</b>(message = nil, *kinds, &amp;block)
569
679
 
570
680
  </div>
571
681
 
572
682
  <div class="description">
573
-
574
683
  <p>
575
684
  Asserts that one of the given kinds of exceptions is raised when the given
576
- block is executed, and returns the exception that was raised.
685
+ block is executed.
686
+ </p>
687
+ <p>
688
+ If the block raises an exception, then that exception is returned.
689
+ </p>
690
+ <p>
691
+ Otherwise, nil is returned.
577
692
  </p>
578
693
  <h4>Parameters</h4>
579
694
  <dl>
@@ -614,41 +729,87 @@ StandardError).
614
729
 
615
730
  <div class="sourcecode">
616
731
  <p class="source-link">
617
- Source: <a href="javascript:toggleSource('M000007_source')" id="l_M000007_source">show</a>
732
+ Source: <a href="javascript:toggleSource('M000009_source')" id="l_M000009_source">show</a>
618
733
 
619
- | <a href="http://github.com/sunaku/dfect/blob/92165fb328974d547b1a9656a2ae92f9c84c96fb/lib/dfect.rb#L285" target="_blank" class="github_url">on GitHub</a>
734
+ | <a href="http://github.com/sunaku/dfect/blob/574a471b9687d6f0aac490200081f0dcd5db8a58/lib/dfect.rb#L344" target="_blank" class="github_url">on GitHub</a>
620
735
 
621
736
  </p>
622
- <div id="M000007_source" class="dyn-source">
623
- <pre><span class="ruby-comment cmt"># File lib/dfect.rb, line 285</span>
737
+ <div id="M000009_source" class="dyn-source">
738
+ <pre><span class="ruby-comment cmt"># File lib/dfect.rb, line 344</span>
624
739
  <span class="ruby-keyword kw">def</span> <span class="ruby-constant">E</span> <span class="ruby-identifier">message</span> = <span class="ruby-keyword kw">nil</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">kinds</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>
625
- <span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-value str">'block must be given'</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">block</span>
740
+ <span class="ruby-identifier">assert_raise</span> <span class="ruby-identifier">:assert</span>, <span class="ruby-identifier">message</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">kinds</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>
741
+ <span class="ruby-keyword kw">end</span></pre>
742
+ </div>
743
+ </div>
744
+
745
+ </div>
746
+
747
+ <div class="method">
748
+ <div class="title" id="M000010">
749
+
750
+ <a name="M000010"></a><b>E!</b>(message = nil, *kinds, &amp;block)
751
+
752
+ </div>
753
+
754
+ <div class="description">
755
+ <p>
756
+ Asserts that one of the given kinds of exceptions is not raised when the
757
+ given block is executed.
758
+ </p>
759
+ <p>
760
+ If the block raises an exception, then that exception is returned.
761
+ </p>
762
+ <p>
763
+ Otherwise, nil is returned.
764
+ </p>
765
+ <h4>Parameters</h4>
766
+ <dl>
767
+ <dt>message</dt><dd>Optional message to show in the report if this assertion fails.
626
768
 
627
- <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">message</span>.<span class="ruby-identifier">is_a?</span> <span class="ruby-constant">Class</span>
628
- <span class="ruby-identifier">kinds</span>.<span class="ruby-identifier">unshift</span> <span class="ruby-identifier">message</span>
629
- <span class="ruby-identifier">message</span> = <span class="ruby-keyword kw">nil</span>
630
- <span class="ruby-keyword kw">end</span>
769
+ </dd>
770
+ <dt>kinds</dt><dd>Exception classes that must not be raised by the given block.
631
771
 
632
- <span class="ruby-identifier">kinds</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-constant">StandardError</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">kinds</span>.<span class="ruby-identifier">empty?</span>
633
- <span class="ruby-identifier">message</span> <span class="ruby-operator">||=</span> <span class="ruby-node">&quot;block must raise #{kinds.join ' or '}&quot;</span>
772
+ <p>
773
+ If none are given, then StandardError is assumed (similar to how a plain
774
+ &#8216;rescue&#8217; statement without any arguments catches
775
+ StandardError).
776
+ </p>
777
+ </dd>
778
+ </dl>
779
+ <h4>Examples</h4>
780
+ <pre>
781
+ # no exceptions specified:
634
782
 
635
- <span class="ruby-keyword kw">begin</span>
636
- <span class="ruby-identifier">block</span>.<span class="ruby-identifier">call</span>
783
+ E! { } # passes
784
+ E! { raise } # fails
637
785
 
638
- <span class="ruby-keyword kw">rescue</span> <span class="ruby-operator">*</span><span class="ruby-identifier">kinds</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">raised</span>
639
- <span class="ruby-ivar">@exec_stats</span>[<span class="ruby-identifier">:passed_assertions</span>] <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
786
+ # single exception specified:
640
787
 
641
- <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Exception</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">raised</span>
642
- <span class="ruby-ivar">@exec_stats</span>[<span class="ruby-identifier">:failed_assertions</span>] <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
788
+ E!( ArgumentError ) { raise ArgumentError } # fails
789
+ E!( &quot;argument must be invalid&quot;, ArgumentError ) { raise ArgumentError }
643
790
 
644
- <span class="ruby-comment cmt"># debug the uncaught exception...</span>
645
- <span class="ruby-identifier">debug_uncaught_exception</span> <span class="ruby-identifier">block</span>, <span class="ruby-identifier">raised</span>
791
+ # multiple exceptions specified:
646
792
 
647
- <span class="ruby-comment cmt"># ...in addition to debugging this assertion</span>
648
- <span class="ruby-identifier">debug</span> <span class="ruby-identifier">block</span>, [<span class="ruby-identifier">message</span>, {<span class="ruby-value str">'block raised'</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">raised</span>}]
649
- <span class="ruby-keyword kw">end</span>
793
+ E!( SyntaxError, NameError ) { eval &quot;...&quot; }
794
+ E!( &quot;string must compile&quot;, SyntaxError, NameError ) { eval &quot;...&quot; }
795
+ </pre>
650
796
 
651
- <span class="ruby-identifier">raised</span>
797
+ </div>
798
+
799
+
800
+
801
+
802
+ <div class="sourcecode">
803
+ <p class="source-link">
804
+ Source: <a href="javascript:toggleSource('M000010_source')" id="l_M000010_source">show</a>
805
+
806
+ | <a href="http://github.com/sunaku/dfect/blob/574a471b9687d6f0aac490200081f0dcd5db8a58/lib/dfect.rb#L386" target="_blank" class="github_url">on GitHub</a>
807
+
808
+ </p>
809
+ <div id="M000010_source" class="dyn-source">
810
+ <pre><span class="ruby-comment cmt"># File lib/dfect.rb, line 386</span>
811
+ <span class="ruby-keyword kw">def</span> <span class="ruby-constant">E!</span> <span class="ruby-identifier">message</span> = <span class="ruby-keyword kw">nil</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">kinds</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>
812
+ <span class="ruby-identifier">assert_raise</span> <span class="ruby-identifier">:negate</span>, <span class="ruby-identifier">message</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">kinds</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>
652
813
  <span class="ruby-keyword kw">end</span></pre>
653
814
  </div>
654
815
  </div>
@@ -656,36 +817,45 @@ StandardError).
656
817
  </div>
657
818
 
658
819
  <div class="method">
659
- <div class="title" id="M000006">
820
+ <div class="title" id="M000011">
660
821
 
661
- <a name="M000006"></a><b>F</b>(message = 'block must yield false (nil || false)', &amp;block)
822
+ <a name="M000011"></a><b>E?</b>(message = nil, *kinds, &amp;block)
662
823
 
663
824
  </div>
664
825
 
665
826
  <div class="description">
666
-
667
827
  <p>
668
- Asserts that the result of the given block is either nil or false and
669
- returns that result.
828
+ Returns true if one of the given kinds of exceptions is raised when the
829
+ given block is executed. Otherwise, returns false.
670
830
  </p>
671
831
  <h4>Parameters</h4>
672
832
  <dl>
673
- <dt>message</dt><dd>Optional message to show in the report if this assertion fails.
833
+ <dt>message</dt><dd>This parameter is optional and completely ignored.
834
+
835
+ </dd>
836
+ <dt>kinds</dt><dd>Exception classes that must be raised by the given block.
674
837
 
838
+ <p>
839
+ If none are given, then StandardError is assumed (similar to how a plain
840
+ &#8216;rescue&#8217; statement without any arguments catches
841
+ StandardError).
842
+ </p>
675
843
  </dd>
676
844
  </dl>
677
845
  <h4>Examples</h4>
678
846
  <pre>
679
- # no message specified:
847
+ # no exceptions specified:
680
848
 
681
- F { true } # fails
849
+ E? { } # =&gt; false
850
+ E? { raise } # =&gt; true
682
851
 
683
- F { false } # passes
684
- F { nil } # passes
852
+ # single exception specified:
685
853
 
686
- # message specified:
854
+ E?( ArgumentError ) { raise ArgumentError } # =&gt; true
855
+
856
+ # multiple exceptions specified:
687
857
 
688
- F( &quot;computers do not doublethink&quot; ) { 2 + 2 == 5 } # passes
858
+ E?( SyntaxError, NameError ) { eval &quot;...&quot; } # =&gt; true
689
859
  </pre>
690
860
 
691
861
  </div>
@@ -695,24 +865,68 @@ returns that result.
695
865
 
696
866
  <div class="sourcecode">
697
867
  <p class="source-link">
698
- Source: <a href="javascript:toggleSource('M000006_source')" id="l_M000006_source">show</a>
868
+ Source: <a href="javascript:toggleSource('M000011_source')" id="l_M000011_source">show</a>
699
869
 
700
- | <a href="http://github.com/sunaku/dfect/blob/92165fb328974d547b1a9656a2ae92f9c84c96fb/lib/dfect.rb#L239" target="_blank" class="github_url">on GitHub</a>
870
+ | <a href="http://github.com/sunaku/dfect/blob/574a471b9687d6f0aac490200081f0dcd5db8a58/lib/dfect.rb#L421" target="_blank" class="github_url">on GitHub</a>
701
871
 
702
872
  </p>
703
- <div id="M000006_source" class="dyn-source">
704
- <pre><span class="ruby-comment cmt"># File lib/dfect.rb, line 239</span>
705
- <span class="ruby-keyword kw">def</span> <span class="ruby-constant">F</span> <span class="ruby-identifier">message</span> = <span class="ruby-value str">'block must yield false (nil || false)'</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>
706
- <span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-value str">'block must be given'</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">block</span>
873
+ <div id="M000011_source" class="dyn-source">
874
+ <pre><span class="ruby-comment cmt"># File lib/dfect.rb, line 421</span>
875
+ <span class="ruby-keyword kw">def</span> <span class="ruby-constant">E?</span> <span class="ruby-identifier">message</span> = <span class="ruby-keyword kw">nil</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">kinds</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>
876
+ <span class="ruby-identifier">assert_raise</span> <span class="ruby-identifier">:sample</span>, <span class="ruby-identifier">message</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">kinds</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>
877
+ <span class="ruby-keyword kw">end</span></pre>
878
+ </div>
879
+ </div>
880
+
881
+ </div>
882
+
883
+ <div class="method">
884
+ <div class="title" id="M000008">
885
+
886
+ <a name="M000008"></a><b>F?</b>(message = nil, &amp;block)
887
+
888
+ </div>
889
+
890
+ <div class="description">
891
+ <p>
892
+ Returns true if the result of the given block is either nil or false.
893
+ Otherwise, returns false.
894
+ </p>
895
+ <h4>Parameters</h4>
896
+ <dl>
897
+ <dt>message</dt><dd>This parameter is optional and completely ignored.
707
898
 
708
- <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">result</span> = <span class="ruby-identifier">call</span>(<span class="ruby-identifier">block</span>)
709
- <span class="ruby-ivar">@exec_stats</span>[<span class="ruby-identifier">:failed_assertions</span>] <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
710
- <span class="ruby-identifier">debug</span> <span class="ruby-identifier">block</span>, <span class="ruby-identifier">message</span>
711
- <span class="ruby-keyword kw">else</span>
712
- <span class="ruby-ivar">@exec_stats</span>[<span class="ruby-identifier">:passed_assertions</span>] <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
713
- <span class="ruby-keyword kw">end</span>
899
+ </dd>
900
+ </dl>
901
+ <h4>Examples</h4>
902
+ <pre>
903
+ # no message specified:
904
+
905
+ F? { true } # =&gt; false
906
+ F? { false } # =&gt; true
907
+ F? { nil } # =&gt; true
908
+
909
+ # message specified:
910
+
911
+ F?( &quot;computers do not doublethink&quot; ) { 2 + 2 == 5 } # =&gt; true
912
+ </pre>
714
913
 
715
- <span class="ruby-identifier">result</span>
914
+ </div>
915
+
916
+
917
+
918
+
919
+ <div class="sourcecode">
920
+ <p class="source-link">
921
+ Source: <a href="javascript:toggleSource('M000008_source')" id="l_M000008_source">show</a>
922
+
923
+ | <a href="http://github.com/sunaku/dfect/blob/574a471b9687d6f0aac490200081f0dcd5db8a58/lib/dfect.rb#L301" target="_blank" class="github_url">on GitHub</a>
924
+
925
+ </p>
926
+ <div id="M000008_source" class="dyn-source">
927
+ <pre><span class="ruby-comment cmt"># File lib/dfect.rb, line 301</span>
928
+ <span class="ruby-keyword kw">def</span> <span class="ruby-constant">F?</span> <span class="ruby-identifier">message</span> = <span class="ruby-keyword kw">nil</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>
929
+ <span class="ruby-keyword kw">not</span> <span class="ruby-constant">T?</span> <span class="ruby-identifier">message</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>
716
930
  <span class="ruby-keyword kw">end</span></pre>
717
931
  </div>
718
932
  </div>
@@ -722,12 +936,11 @@ returns that result.
722
936
  <div class="method">
723
937
  <div class="title" id="M000005">
724
938
 
725
- <a name="M000005"></a><b>T</b>(message = 'block must yield true (!nil &amp;&amp; !false)', &amp;block)
939
+ <a name="M000005"></a><b>T</b>(message = nil, &amp;block)
726
940
 
727
941
  </div>
728
942
 
729
943
  <div class="description">
730
-
731
944
  <p>
732
945
  Asserts that the result of the given block is neither nil nor false and
733
946
  returns that result.
@@ -743,7 +956,6 @@ returns that result.
743
956
  # no message specified:
744
957
 
745
958
  T { true } # passes
746
-
747
959
  T { false } # fails
748
960
  T { nil } # fails
749
961
 
@@ -761,22 +973,66 @@ returns that result.
761
973
  <p class="source-link">
762
974
  Source: <a href="javascript:toggleSource('M000005_source')" id="l_M000005_source">show</a>
763
975
 
764
- | <a href="http://github.com/sunaku/dfect/blob/92165fb328974d547b1a9656a2ae92f9c84c96fb/lib/dfect.rb#L203" target="_blank" class="github_url">on GitHub</a>
976
+ | <a href="http://github.com/sunaku/dfect/blob/574a471b9687d6f0aac490200081f0dcd5db8a58/lib/dfect.rb#L221" target="_blank" class="github_url">on GitHub</a>
765
977
 
766
978
  </p>
767
979
  <div id="M000005_source" class="dyn-source">
768
- <pre><span class="ruby-comment cmt"># File lib/dfect.rb, line 203</span>
769
- <span class="ruby-keyword kw">def</span> <span class="ruby-constant">T</span> <span class="ruby-identifier">message</span> = <span class="ruby-value str">'block must yield true (!nil &amp;&amp; !false)'</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>
770
- <span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-value str">'block must be given'</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">block</span>
980
+ <pre><span class="ruby-comment cmt"># File lib/dfect.rb, line 221</span>
981
+ <span class="ruby-keyword kw">def</span> <span class="ruby-constant">T</span> <span class="ruby-identifier">message</span> = <span class="ruby-keyword kw">nil</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>
982
+ <span class="ruby-identifier">assert_block</span> <span class="ruby-identifier">:assert</span>, <span class="ruby-identifier">message</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>
983
+ <span class="ruby-keyword kw">end</span></pre>
984
+ </div>
985
+ </div>
986
+
987
+ </div>
988
+
989
+ <div class="method">
990
+ <div class="title" id="M000006">
991
+
992
+ <a name="M000006"></a><b>T!</b>(message = nil, &amp;block)
993
+
994
+ </div>
995
+
996
+ <div class="description">
997
+ <p>
998
+ Asserts that the result of the given block is either nil or false and
999
+ returns that result.
1000
+ </p>
1001
+ <h4>Parameters</h4>
1002
+ <dl>
1003
+ <dt>message</dt><dd>Optional message to show in the report if this assertion fails.
771
1004
 
772
- <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">result</span> = <span class="ruby-identifier">call</span>(<span class="ruby-identifier">block</span>)
773
- <span class="ruby-ivar">@exec_stats</span>[<span class="ruby-identifier">:passed_assertions</span>] <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
774
- <span class="ruby-keyword kw">else</span>
775
- <span class="ruby-ivar">@exec_stats</span>[<span class="ruby-identifier">:failed_assertions</span>] <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
776
- <span class="ruby-identifier">debug</span> <span class="ruby-identifier">block</span>, <span class="ruby-identifier">message</span>
777
- <span class="ruby-keyword kw">end</span>
1005
+ </dd>
1006
+ </dl>
1007
+ <h4>Examples</h4>
1008
+ <pre>
1009
+ # no message specified:
1010
+
1011
+ T! { true } # fails
1012
+ T! { false } # passes
1013
+ T! { nil } # passes
1014
+
1015
+ # message specified:
1016
+
1017
+ T!( &quot;computers do not doublethink&quot; ) { 2 + 2 == 5 } # passes
1018
+ </pre>
778
1019
 
779
- <span class="ruby-identifier">result</span>
1020
+ </div>
1021
+
1022
+
1023
+
1024
+
1025
+ <div class="sourcecode">
1026
+ <p class="source-link">
1027
+ Source: <a href="javascript:toggleSource('M000006_source')" id="l_M000006_source">show</a>
1028
+
1029
+ | <a href="http://github.com/sunaku/dfect/blob/574a471b9687d6f0aac490200081f0dcd5db8a58/lib/dfect.rb#L247" target="_blank" class="github_url">on GitHub</a>
1030
+
1031
+ </p>
1032
+ <div id="M000006_source" class="dyn-source">
1033
+ <pre><span class="ruby-comment cmt"># File lib/dfect.rb, line 247</span>
1034
+ <span class="ruby-keyword kw">def</span> <span class="ruby-constant">T!</span> <span class="ruby-identifier">message</span> = <span class="ruby-keyword kw">nil</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>
1035
+ <span class="ruby-identifier">assert_block</span> <span class="ruby-identifier">:negate</span>, <span class="ruby-identifier">message</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>
780
1036
  <span class="ruby-keyword kw">end</span></pre>
781
1037
  </div>
782
1038
  </div>
@@ -784,14 +1040,66 @@ returns that result.
784
1040
  </div>
785
1041
 
786
1042
  <div class="method">
787
- <div class="title" id="M000009">
1043
+ <div class="title" id="M000007">
788
1044
 
789
- <a name="M000009"></a><b>run</b>()
1045
+ <a name="M000007"></a><b>T?</b>(message = nil, &amp;block)
1046
+
1047
+ </div>
1048
+
1049
+ <div class="description">
1050
+ <p>
1051
+ Returns true if the result of the given block is neither nil nor false.
1052
+ Otherwise, returns false.
1053
+ </p>
1054
+ <h4>Parameters</h4>
1055
+ <dl>
1056
+ <dt>message</dt><dd>This parameter is optional and completely ignored.
1057
+
1058
+ </dd>
1059
+ </dl>
1060
+ <h4>Examples</h4>
1061
+ <pre>
1062
+ # no message specified:
1063
+
1064
+ T? { true } # =&gt; true
1065
+ T? { false } # =&gt; false
1066
+ T? { nil } # =&gt; false
1067
+
1068
+ # message specified:
1069
+
1070
+ T?( &quot;computers do not doublethink&quot; ) { 2 + 2 != 5 } # =&gt; true
1071
+ </pre>
1072
+
1073
+ </div>
1074
+
1075
+
1076
+
1077
+
1078
+ <div class="sourcecode">
1079
+ <p class="source-link">
1080
+ Source: <a href="javascript:toggleSource('M000007_source')" id="l_M000007_source">show</a>
1081
+
1082
+ | <a href="http://github.com/sunaku/dfect/blob/574a471b9687d6f0aac490200081f0dcd5db8a58/lib/dfect.rb#L272" target="_blank" class="github_url">on GitHub</a>
1083
+
1084
+ </p>
1085
+ <div id="M000007_source" class="dyn-source">
1086
+ <pre><span class="ruby-comment cmt"># File lib/dfect.rb, line 272</span>
1087
+ <span class="ruby-keyword kw">def</span> <span class="ruby-constant">T?</span> <span class="ruby-identifier">message</span> = <span class="ruby-keyword kw">nil</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>
1088
+ <span class="ruby-identifier">assert_block</span> <span class="ruby-identifier">:sample</span>, <span class="ruby-identifier">message</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>
1089
+ <span class="ruby-keyword kw">end</span></pre>
1090
+ </div>
1091
+ </div>
1092
+
1093
+ </div>
1094
+
1095
+ <div class="method">
1096
+ <div class="title" id="M000015">
1097
+
1098
+ <a name="M000015"></a><b>run</b>()
790
1099
 
791
1100
  </div>
792
1101
 
793
1102
  <div class="description">
794
-
795
1103
  <p>
796
1104
  Executes all tests defined thus far and stores the results in <a
797
1105
  href="Dfect.html#report">report</a>.
@@ -804,13 +1112,13 @@ href="Dfect.html#report">report</a>.
804
1112
 
805
1113
  <div class="sourcecode">
806
1114
  <p class="source-link">
807
- Source: <a href="javascript:toggleSource('M000009_source')" id="l_M000009_source">show</a>
1115
+ Source: <a href="javascript:toggleSource('M000015_source')" id="l_M000015_source">show</a>
808
1116
 
809
- | <a href="http://github.com/sunaku/dfect/blob/92165fb328974d547b1a9656a2ae92f9c84c96fb/lib/dfect.rb#L371" target="_blank" class="github_url">on GitHub</a>
1117
+ | <a href="http://github.com/sunaku/dfect/blob/574a471b9687d6f0aac490200081f0dcd5db8a58/lib/dfect.rb#L522" target="_blank" class="github_url">on GitHub</a>
810
1118
 
811
1119
  </p>
812
- <div id="M000009_source" class="dyn-source">
813
- <pre><span class="ruby-comment cmt"># File lib/dfect.rb, line 371</span>
1120
+ <div id="M000015_source" class="dyn-source">
1121
+ <pre><span class="ruby-comment cmt"># File lib/dfect.rb, line 522</span>
814
1122
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">run</span>
815
1123
  <span class="ruby-comment cmt"># clear previous results</span>
816
1124
  <span class="ruby-ivar">@exec_stats</span>.<span class="ruby-identifier">clear</span>
@@ -831,16 +1139,15 @@ href="Dfect.html#report">report</a>.
831
1139
  </div>
832
1140
 
833
1141
  <div class="method">
834
- <div class="title" id="M000010">
1142
+ <div class="title" id="M000016">
835
1143
 
836
- <a name="M000010"></a><b>stop</b>()
1144
+ <a name="M000016"></a><b>stop</b>()
837
1145
 
838
1146
  </div>
839
1147
 
840
1148
  <div class="description">
841
-
842
1149
  <p>
843
- Stops the execution of the <a href="Dfect.html#M000009">run</a> method or
1150
+ Stops the execution of the <a href="Dfect.html#M000015">run</a> method or
844
1151
  raises an exception if that method is not currently executing.
845
1152
  </p>
846
1153
 
@@ -851,13 +1158,13 @@ raises an exception if that method is not currently executing.
851
1158
 
852
1159
  <div class="sourcecode">
853
1160
  <p class="source-link">
854
- Source: <a href="javascript:toggleSource('M000010_source')" id="l_M000010_source">show</a>
1161
+ Source: <a href="javascript:toggleSource('M000016_source')" id="l_M000016_source">show</a>
855
1162
 
856
- | <a href="http://github.com/sunaku/dfect/blob/92165fb328974d547b1a9656a2ae92f9c84c96fb/lib/dfect.rb#L390" target="_blank" class="github_url">on GitHub</a>
1163
+ | <a href="http://github.com/sunaku/dfect/blob/574a471b9687d6f0aac490200081f0dcd5db8a58/lib/dfect.rb#L541" target="_blank" class="github_url">on GitHub</a>
857
1164
 
858
1165
  </p>
859
- <div id="M000010_source" class="dyn-source">
860
- <pre><span class="ruby-comment cmt"># File lib/dfect.rb, line 390</span>
1166
+ <div id="M000016_source" class="dyn-source">
1167
+ <pre><span class="ruby-comment cmt"># File lib/dfect.rb, line 541</span>
861
1168
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">stop</span>
862
1169
  <span class="ruby-identifier">throw</span> <span class="ruby-identifier">:stop_dfect_execution</span>
863
1170
  <span class="ruby-keyword kw">end</span></pre>