doc/api/Dfect.html in dfect-2.0.0 vs doc/api/Dfect.html in dfect-2.1.0

- old
+ new

@@ -1,10 +1,10 @@ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> - <meta name="Content-Type" content="text/html; charset=UTF-8" /> + <meta name="Content-Type" content="text/html; charset=utf-8" /> <title>Module: Dfect</title> <link rel="stylesheet" href="css/style.css" type="text/css" media="screen" charset="utf-8" /> <link rel="stylesheet" href="css/common.css" type="text/css" media="screen" charset="utf-8" /> <script type="text/javascript" charset="utf-8"> @@ -54,12 +54,17 @@ - <dt class="r1 last">Defined in:</dt> - <dd class="r1 last">lib/dfect.rb<span class="defines">,<br /> + <dt class="r1">Included in:</dt> + <dd class="r1"><a href="Object.html" title="Object (class)">Object</a></dd> + + + + <dt class="r2 last">Defined in:</dt> + <dd class="r2 last">lib/dfect.rb<span class="defines">,<br /> lib/dfect/mini.rb,<br /> lib/dfect/spec.rb,<br /> lib/dfect/unit.rb,<br /> lib/dfect/inochi.rb</span> </dd> </dl> <div class="clear"></div> @@ -68,23 +73,200 @@ <h2>Constant Summary</h2> <dl class="constants"> <dt id="D-constant" class="">D = - <span class="summary_desc"> + <div class="docstring"> + <div class="discussion"> + <p> Allows before and after hooks to be specified via the following method -syntax when this module is mixed-in:. +syntax when this module is mixed-in: +</p> +<pre class="code"> + <span class='const'>D</span> <span class='period'>.</span><span class='op'>&lt;&lt;</span> <span class='lbrace'>{</span> <span class='id puts'>puts</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>before all nested tests</span><span class='tstring_end'>&quot;</span></span> <span class='rbrace'>}</span> + <span class='const'>D</span> <span class='period'>.</span><span class='op'>&lt;</span> <span class='lbrace'>{</span> <span class='id puts'>puts</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>before each nested test</span><span class='tstring_end'>&quot;</span></span> <span class='rbrace'>}</span> + <span class='const'>D</span> <span class='period'>.</span><span class='op'>&gt;</span> <span class='lbrace'>{</span> <span class='id puts'>puts</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>after each nested test</span><span class='tstring_end'>&quot;</span></span> <span class='rbrace'>}</span> + <span class='const'>D</span> <span class='period'>.</span><span class='op'>&gt;&gt;</span> <span class='lbrace'>{</span> <span class='id puts'>puts</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>after all nested tests</span><span class='tstring_end'>&quot;</span></span> <span class='rbrace'>}</span> +</pre> -</span> + + </div> +</div> +<div class="tags"> + +</div> </dt> <dd><pre class="code"><span class='kw'>self</span></pre></dd> + <dt id="PROJECT-constant" class="">PROJECT = + <div class="docstring"> + <div class="discussion"> + <p> +Official name of this project. +</p> + + + </div> +</div> +<div class="tags"> + +</div> + </dt> + <dd><pre class="code"><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Dfect</span><span class='tstring_end'>&quot;</span></span></pre></dd> + + <dt id="TAGLINE-constant" class="">TAGLINE = + <div class="docstring"> + <div class="discussion"> + <p> +Short single-line description of this project. +</p> + + + </div> +</div> +<div class="tags"> + +</div> + </dt> + <dd><pre class="code"><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Assertion testing library for Ruby</span><span class='tstring_end'>&quot;</span></span></pre></dd> + + <dt id="WEBSITE-constant" class="">WEBSITE = + <div class="docstring"> + <div class="discussion"> + <p> +Address of this project&#8217;s official home page. +</p> + + + </div> +</div> +<div class="tags"> + +</div> + </dt> + <dd><pre class="code"><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>http://snk.tuxfamily.org/lib/dfect/</span><span class='tstring_end'>&quot;</span></span></pre></dd> + + <dt id="VERSION-constant" class="">VERSION = + <div class="docstring"> + <div class="discussion"> + <p> +Number of this release of this project. +</p> + + + </div> +</div> +<div class="tags"> + +</div> + </dt> + <dd><pre class="code"><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>2.1.0</span><span class='tstring_end'>&quot;</span></span></pre></dd> + + <dt id="RELDATE-constant" class="">RELDATE = + <div class="docstring"> + <div class="discussion"> + <p> +Date of this release of this project. +</p> + + + </div> +</div> +<div class="tags"> + +</div> + </dt> + <dd><pre class="code"><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>2010-03-31</span><span class='tstring_end'>&quot;</span></span></pre></dd> + <dt id="INSTDIR-constant" class="">INSTDIR = - <span class="summary_desc"></span> + <div class="docstring"> + <div class="discussion"> + <p> +Location of this release of this project. +</p> + + + </div> +</div> +<div class="tags"> + +</div> </dt> <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> + <dt id="RUNTIME-constant" class="">RUNTIME = + <div class="docstring"> + <div class="discussion"> + <p> +RubyGems required by this project during runtime. +</p> + + + </div> +</div> +<div class="tags"> + + <div class="examples"> + <h3>Examples:</h3> + + <h4><div class='inline'></div></h4> + <pre class="example code"> +<span class='const'>RUNTIME</span> <span class='op'>=</span> <span class='lbrace'>{</span> + <span class='comment'># this project needs exactly version 1.2.3 of the &quot;an_example&quot; gem +</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>an_example</span><span class='tstring_end'>&quot;</span></span> <span class='op'>=&gt;</span> <span class='lbracket'>[</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>1.2.3</span><span class='tstring_end'>&quot;</span></span> <span class='rbracket'>]</span><span class='comma'>,</span> + + <span class='comment'># this project needs at least version 1.2 (but not +</span> <span class='comment'># version 1.2.4 or newer) of the &quot;another_example&quot; gem +</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>another_example</span><span class='tstring_end'>&quot;</span></span> <span class='op'>=&gt;</span> <span class='lbracket'>[</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>&gt;= 1.2</span><span class='tstring_end'>&quot;</span></span> <span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>&lt; 1.2.4</span><span class='tstring_end'>&quot;</span></span> <span class='rbracket'>]</span><span class='comma'>,</span> + + <span class='comment'># this project needs any version of the &quot;yet_another_example&quot; gem +</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>yet_another_example</span><span class='tstring_end'>&quot;</span></span> <span class='op'>=&gt;</span> <span class='lbracket'>[</span><span class='rbracket'>]</span><span class='comma'>,</span> +<span class='rbrace'>}</span></pre> + + </div> + +</div> + </dt> + <dd><pre class="code"><span class='lbrace'>{</span><span class='rbrace'>}</span></pre></dd> + + <dt id="DEVTIME-constant" class="">DEVTIME = + <div class="docstring"> + <div class="discussion"> + <p> +RubyGems required by this project during development. +</p> + + + </div> +</div> +<div class="tags"> + + <div class="examples"> + <h3>Examples:</h3> + + <h4><div class='inline'></div></h4> + <pre class="example code"> +<span class='const'>DEVTIME</span> <span class='op'>=</span> <span class='lbrace'>{</span> + <span class='comment'># this project needs exactly version 1.2.3 of the &quot;an_example&quot; gem +</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>an_example</span><span class='tstring_end'>&quot;</span></span> <span class='op'>=&gt;</span> <span class='lbracket'>[</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>1.2.3</span><span class='tstring_end'>&quot;</span></span> <span class='rbracket'>]</span><span class='comma'>,</span> + + <span class='comment'># this project needs at least version 1.2 (but not +</span> <span class='comment'># version 1.2.4 or newer) of the &quot;another_example&quot; gem +</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>another_example</span><span class='tstring_end'>&quot;</span></span> <span class='op'>=&gt;</span> <span class='lbracket'>[</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>&gt;= 1.2</span><span class='tstring_end'>&quot;</span></span> <span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>&lt; 1.2.4</span><span class='tstring_end'>&quot;</span></span> <span class='rbracket'>]</span><span class='comma'>,</span> + + <span class='comment'># this project needs any version of the &quot;yet_another_example&quot; gem +</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>yet_another_example</span><span class='tstring_end'>&quot;</span></span> <span class='op'>=&gt;</span> <span class='lbracket'>[</span><span class='rbracket'>]</span><span class='comma'>,</span> +<span class='rbrace'>}</span></pre> + + </div> + +</div> + </dt> + <dd><pre class="code"><span class='lbrace'>{</span> + <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>inochi</span><span class='tstring_end'>&quot;</span></span> <span class='op'>=&gt;</span> <span class='lbracket'>[</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>~&gt; 2</span><span class='tstring_end'>&quot;</span></span> <span class='rbracket'>]</span><span class='comma'>,</span> <span class='comment'># for managing this project +</span><span class='rbrace'>}</span></pre></dd> + </dl> <h2>Class Attribute Summary</h2> @@ -106,14 +288,14 @@ - <span class="summary_desc"> + <span class="summary_desc"><div class='inline'><p> Hash of choices that affect how Dfect operates. - -</span> +</p> +</div></span> </li> <li class="public "> @@ -132,26 +314,27 @@ - <span class="summary_desc"> + <span class="summary_desc"><div class='inline'><p> Hash of test results, assembled by <tt><a href="#run-class_method" title="Dfect.run (method)">Dfect.run</a></tt>. - -</span> +</p> +</div></span> </li> </ul> - <h2>Class Method Summary</h2> + + <h2>Class Method Summary</h2> - <ul class="summary"> - - <li class="public "> + <ul class="summary"> + + <li class="public "> <span class="summary_signature"> <a href="#%3C-class_method" title="&lt; (class method)">+ (Object) <strong>&lt;</strong>(&amp;block) </a> @@ -162,20 +345,20 @@ - <span class="summary_desc"> + <span class="summary_desc"><div class='inline'><p> Registers the given block to be executed before each nested test inside this test. - -</span> +</p> +</div></span> </li> - - <li class="public "> + + <li class="public "> <span class="summary_signature"> <a href="#%3C%3C-class_method" title="&lt;&lt; (class method)">+ (Object) <strong>&lt;&lt;</strong>(&amp;block) </a> @@ -186,20 +369,20 @@ - <span class="summary_desc"> + <span class="summary_desc"><div class='inline'><p> Registers the given block to be executed before all nested tests inside this test. - -</span> +</p> +</div></span> </li> - - <li class="public "> + + <li class="public "> <span class="summary_signature"> <a href="#%3E-class_method" title="&gt; (class method)">+ (Object) <strong>&gt;</strong>(&amp;block) </a> @@ -210,20 +393,20 @@ - <span class="summary_desc"> + <span class="summary_desc"><div class='inline'><p> Registers the given block to be executed after each nested test inside this test. - -</span> +</p> +</div></span> </li> - - <li class="public "> + + <li class="public "> <span class="summary_signature"> <a href="#%3E%3E-class_method" title="&gt;&gt; (class method)">+ (Object) <strong>&gt;&gt;</strong>(&amp;block) </a> @@ -234,20 +417,20 @@ - <span class="summary_desc"> + <span class="summary_desc"><div class='inline'><p> Registers the given block to be executed after all nested tests inside this test. - -</span> +</p> +</div></span> </li> - - <li class="public "> + + <li class="public "> <span class="summary_signature"> <a href="#C-class_method" title="C (class method)">+ (Object) <strong>C</strong>(symbol, message = nil, &amp;block) </a> @@ -258,19 +441,19 @@ - <span class="summary_desc"> + <span class="summary_desc"><div class='inline'><p> Asserts that the given symbol is thrown when the given block is executed. - -</span> +</p> +</div></span> </li> - - <li class="public "> + + <li class="public "> <span class="summary_signature"> <a href="#C%21-class_method" title="C! (class method)">+ (Object) <strong>C!</strong>(symbol, message = nil, &amp;block) </a> @@ -281,20 +464,20 @@ - <span class="summary_desc"> + <span class="summary_desc"><div class='inline'><p> Asserts that the given symbol is not thrown when the given block is executed. - -</span> +</p> +</div></span> </li> - - <li class="public "> + + <li class="public "> <span class="summary_signature"> <a href="#C%3F-class_method" title="C? (class method)">+ (Boolean) <strong>C?</strong>(symbol, message = nil, &amp;block) </a> @@ -305,20 +488,20 @@ - <span class="summary_desc"> + <span class="summary_desc"><div class='inline'><p> Returns true if the given symbol is thrown when the given block is executed. - -</span> +</p> +</div></span> </li> - - <li class="public "> + + <li class="public "> <span class="summary_signature"> <a href="#D-class_method" title="D (class method)">+ (Object) <strong>D</strong>(*description, &amp;block) </a> @@ -329,20 +512,20 @@ - <span class="summary_desc"> + <span class="summary_desc"><div class='inline'><p> Defines a new test composed of the given description and the given block to execute. - -</span> +</p> +</div></span> </li> - - <li class="public "> + + <li class="public "> <span class="summary_signature"> <a href="#D%21-class_method" title="D! (class method)">+ (Object) <strong>D!</strong>(*description, &amp;block) </a> @@ -353,20 +536,20 @@ - <span class="summary_desc"> + <span class="summary_desc"><div class='inline'><p> Defines a new test that is explicitly insulated from the tests that contain it and also from the top-level Ruby environment. - -</span> +</p> +</div></span> </li> - - <li class="public "> + + <li class="public "> <span class="summary_signature"> <a href="#E-class_method" title="E (class method)">+ (Object) <strong>E</strong>(*kinds_then_message, &amp;block) </a> @@ -377,20 +560,20 @@ - <span class="summary_desc"> + <span class="summary_desc"><div class='inline'><p> Asserts that one of the given kinds of exceptions is raised when the given block is executed. - -</span> +</p> +</div></span> </li> - - <li class="public "> + + <li class="public "> <span class="summary_signature"> <a href="#E%21-class_method" title="E! (class method)">+ (Object) <strong>E!</strong>(*kinds_then_message, &amp;block) </a> @@ -401,20 +584,20 @@ - <span class="summary_desc"> + <span class="summary_desc"><div class='inline'><p> Asserts that one of the given kinds of exceptions is not raised when the given block is executed. - -</span> +</p> +</div></span> </li> - - <li class="public "> + + <li class="public "> <span class="summary_signature"> <a href="#E%3F-class_method" title="E? (class method)">+ (Boolean) <strong>E?</strong>(*kinds_then_message, &amp;block) </a> @@ -425,20 +608,20 @@ - <span class="summary_desc"> + <span class="summary_desc"><div class='inline'><p> Returns true if one of the given kinds of exceptions is raised when the given block is executed. - -</span> +</p> +</div></span> </li> - - <li class="public "> + + <li class="public "> <span class="summary_signature"> <a href="#F%3F-class_method" title="F? (class method)">+ (Boolean) <strong>F?</strong>(message = nil, &amp;block) </a> @@ -449,19 +632,19 @@ - <span class="summary_desc"> + <span class="summary_desc"><div class='inline'><p> Returns true if the result of the given block is either nil or false. - -</span> +</p> +</div></span> </li> - - <li class="public "> + + <li class="public "> <span class="summary_signature"> <a href="#info-class_method" title="info (class method)">+ (Object) <strong>info</strong> </a> @@ -472,20 +655,20 @@ - <span class="summary_desc"> + <span class="summary_desc"><div class='inline'><p> Returns the details of the failure that is currently being debugged by the user. - -</span> +</p> +</div></span> </li> - - <li class="public "> + + <li class="public "> <span class="summary_signature"> <a href="#inspect-class_method" title="inspect (class method)">+ (Object) <strong>inspect</strong> </a> @@ -496,16 +679,19 @@ - <span class="summary_desc"></span> + <span class="summary_desc"><div class='inline'><p> +Description of this release of this project. +</p> +</div></span> </li> - - <li class="public "> + + <li class="public "> <span class="summary_signature"> <a href="#L-class_method" title="L (class method)">+ (Object) <strong>L</strong>(*messages) </a> @@ -516,20 +702,45 @@ - <span class="summary_desc"> + <span class="summary_desc"><div class='inline'><p> Adds the given messages to the report inside the section of the currently running test. - -</span> +</p> +</div></span> </li> + + <li class="public "> + <span class="summary_signature"> - <li class="public "> + <a href="#require-class_method" title="require (class method)">+ (Object) <strong>require</strong>(gem_name_or_library) </a> + + + + </span> + + + + + + + + <span class="summary_desc"><div class='inline'><p> +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> +constant in this module) of the given gem or the gem that contains the +given library. +</p> +</div></span> + +</li> + + + <li class="public "> <span class="summary_signature"> <a href="#run-class_method" title="run (class method)">+ (Object) <strong>run</strong>(continue = true) </a> @@ -540,20 +751,20 @@ - <span class="summary_desc"> + <span class="summary_desc"><div class='inline'><p> Executes all tests defined thus far and stores the results in <tt><a href="#report-class_method" title="Dfect.report (method)">Dfect.report</a></tt>. - -</span> +</p> +</div></span> </li> - - <li class="public "> + + <li class="public "> <span class="summary_signature"> <a href="#S-class_method" title="S (class method)">+ (Object) <strong>S</strong>(identifier, &amp;block) </a> @@ -564,19 +775,19 @@ - <span class="summary_desc"> + <span class="summary_desc"><div class='inline'><p> Mechanism for sharing code between tests. - -</span> +</p> +</div></span> </li> - - <li class="public "> + + <li class="public "> <span class="summary_signature"> <a href="#S%21-class_method" title="S! (class method)">+ (Object) <strong>S!</strong>(identifier, &amp;block) </a> @@ -587,21 +798,21 @@ - <span class="summary_desc"> + <span class="summary_desc"><div class='inline'><p> Shares the given code block under the given identifier and then immediately injects that code block into the closest insulated Dfect test that contains the call to this method. - -</span> +</p> +</div></span> </li> - - <li class="public "> + + <li class="public "> <span class="summary_signature"> <a href="#S%3F-class_method" title="S? (class method)">+ (Boolean) <strong>S?</strong>(identifier) </a> @@ -612,19 +823,19 @@ - <span class="summary_desc"> + <span class="summary_desc"><div class='inline'><p> Checks whether any code has been shared under the given identifier. - -</span> +</p> +</div></span> </li> - - <li class="public "> + + <li class="public "> <span class="summary_signature"> <a href="#stop-class_method" title="stop (class method)">+ (Object) <strong>stop</strong> </a> @@ -635,20 +846,20 @@ - <span class="summary_desc"> + <span class="summary_desc"><div class='inline'><p> 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 that method is not currently executing. - -</span> +</p> +</div></span> </li> - - <li class="public "> + + <li class="public "> <span class="summary_signature"> <a href="#T-class_method" title="T (class method)">+ (Object) <strong>T</strong>(condition = nil, message = nil, &amp;block) </a> @@ -661,20 +872,20 @@ - <span class="summary_desc"> + <span class="summary_desc"><div class='inline'><p> Asserts that the given condition or the result of the given block is neither nil nor false and returns that result. - -</span> +</p> +</div></span> </li> - - <li class="public "> + + <li class="public "> <span class="summary_signature"> <a href="#T%21-class_method" title="T! (class method)">+ (Object) <strong>T!</strong>(condition = nil, message = nil, &amp;block) </a> @@ -687,20 +898,20 @@ - <span class="summary_desc"> + <span class="summary_desc"><div class='inline'><p> Asserts that the given condition or the result of the given block is either nil or false and returns that result. - -</span> +</p> +</div></span> </li> - - <li class="public "> + + <li class="public "> <span class="summary_signature"> <a href="#T%3F-class_method" title="T? (class method)">+ (Boolean) <strong>T?</strong>(condition = nil, message = nil, &amp;block) </a> @@ -711,26 +922,26 @@ - <span class="summary_desc"> + <span class="summary_desc"><div class='inline'><p> Returns true if the given condition or the result of the given block is neither nil nor false. - -</span> +</p> +</div></span> </li> - - </ul> + + </ul> + + <h2>Instance Method Summary</h2> - <h2>Instance Method Summary</h2> - - <ul class="summary"> - - <li class="public "> + <ul class="summary"> + + <li class="public "> <span class="summary_signature"> <a href="#after-instance_method" title="#after (instance method)">- (Object) <strong>after</strong>(what, &amp;block) </a> @@ -741,16 +952,16 @@ - <span class="summary_desc"></span> + <span class="summary_desc"><div class='inline'></div></span> </li> - - <li class="public "> + + <li class="public "> <span class="summary_signature"> <a href="#before-instance_method" title="#before (instance method)">- (Object) <strong>before</strong>(what, &amp;block) </a> @@ -761,17 +972,19 @@ - <span class="summary_desc"></span> + <span class="summary_desc"><div class='inline'></div></span> </li> - - </ul> + + </ul> + + <div id="class_attr_details" class="attr_details"> <h2>Class Attribute Details</h2> <span id="options=-class_method"></span> @@ -813,16 +1026,16 @@ <tr> <td> <pre class="lines"> -93 -94 -95</pre> +88 +89 +90</pre> </td> <td> - <pre class="code"><span class="info file"># File 'lib/dfect.rb', line 93</span> + <pre class="code"><span class="info file"># File 'lib/dfect.rb', line 88</span> <span class='kw'>def</span> <span class='id options'>options</span> <span class='ivar'>@options</span> <span class='kw'>end</span></pre> </td> @@ -896,16 +1109,16 @@ <tr> <td> <pre class="lines"> -75 -76 -77</pre> +70 +71 +72</pre> </td> <td> - <pre class="code"><span class="info file"># File 'lib/dfect.rb', line 75</span> + <pre class="code"><span class="info file"># File 'lib/dfect.rb', line 70</span> <span class='kw'>def</span> <span class='id report'>report</span> <span class='ivar'>@report</span> <span class='kw'>end</span></pre> </td> @@ -936,17 +1149,17 @@ <div class="tags"> <div class="examples"> <h3>Examples:</h3> - <h4></h4> + <h4><div class='inline'></div></h4> <pre class="example code"> - <span class='const'>D</span> <span class='period'>.</span><span class='op'>&lt;</span> <span class='lbrace'>{</span> <span class='id puts'>puts</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>before each nested test</span><span class='tstring_end'>&quot;</span></span> <span class='rbrace'>}</span> +<span class='const'>D</span> <span class='period'>.</span><span class='op'>&lt;</span> <span class='lbrace'>{</span> <span class='id puts'>puts</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>before each nested test</span><span class='tstring_end'>&quot;</span></span> <span class='rbrace'>}</span> - <span class='const'>D</span> <span class='period'>.</span><span class='op'>&lt;</span> <span class='kw'>do</span> - <span class='id puts'>puts</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>before each nested test</span><span class='tstring_end'>&quot;</span></span> - <span class='kw'>end</span></pre> +<span class='const'>D</span> <span class='period'>.</span><span class='op'>&lt;</span> <span class='kw'>do</span> + <span class='id puts'>puts</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>before each nested test</span><span class='tstring_end'>&quot;</span></span> +<span class='kw'>end</span></pre> </div> <div class="docstring"> <div class="discussion"> @@ -966,22 +1179,22 @@ <tr> <td> <pre class="lines"> +177 +178 +179 +180 +181 182 183 184 -185 -186 -187 -188 -189 -190</pre> +185</pre> </td> <td> - <pre class="code"><span class="info file"># File 'lib/dfect.rb', line 182</span> + <pre class="code"><span class="info file"># File 'lib/dfect.rb', line 177</span> <span class='kw'>def</span> <span class='op'>&lt;</span><span class='lparen'>(</span><span class='op'>*</span><span class='id args'>args</span><span class='comma'>,</span> <span class='op'>&amp;</span><span class='id block'>block</span><span class='rparen'>)</span> <span class='kw'>if</span> <span class='id args'>args</span><span class='period'>.</span><span class='id empty?'>empty?</span> <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> <span class='ivar'>@suite</span><span class='period'>.</span><span class='id before_each'>before_each</span> <span class='op'>&lt;&lt;</span> <span class='id block'>block</span> @@ -1015,17 +1228,17 @@ <div class="tags"> <div class="examples"> <h3>Examples:</h3> - <h4></h4> + <h4><div class='inline'></div></h4> <pre class="example code"> - <span class='const'>D</span> <span class='period'>.</span><span class='op'>&lt;&lt;</span> <span class='lbrace'>{</span> <span class='id puts'>puts</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>before all nested tests</span><span class='tstring_end'>&quot;</span></span> <span class='rbrace'>}</span> +<span class='const'>D</span> <span class='period'>.</span><span class='op'>&lt;&lt;</span> <span class='lbrace'>{</span> <span class='id puts'>puts</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>before all nested tests</span><span class='tstring_end'>&quot;</span></span> <span class='rbrace'>}</span> - <span class='const'>D</span> <span class='period'>.</span><span class='op'>&lt;&lt;</span> <span class='kw'>do</span> - <span class='id puts'>puts</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>before all nested tests</span><span class='tstring_end'>&quot;</span></span> - <span class='kw'>end</span></pre> +<span class='const'>D</span> <span class='period'>.</span><span class='op'>&lt;&lt;</span> <span class='kw'>do</span> + <span class='id puts'>puts</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>before all nested tests</span><span class='tstring_end'>&quot;</span></span> +<span class='kw'>end</span></pre> </div> <h3>Raises:</h3> <ul class="raise"> @@ -1044,17 +1257,17 @@ <tr> <td> <pre class="lines"> -221 -222 -223 -224</pre> +216 +217 +218 +219</pre> </td> <td> - <pre class="code"><span class="info file"># File 'lib/dfect.rb', line 221</span> + <pre class="code"><span class="info file"># File 'lib/dfect.rb', line 216</span> <span class='kw'>def</span> <span class='op'>&lt;&lt;</span> <span class='op'>&amp;</span><span class='id block'>block</span> <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> <span class='ivar'>@suite</span><span class='period'>.</span><span class='id before_all'>before_all</span> <span class='op'>&lt;&lt;</span> <span class='id block'>block</span> <span class='kw'>end</span></pre> @@ -1083,17 +1296,17 @@ <div class="tags"> <div class="examples"> <h3>Examples:</h3> - <h4></h4> + <h4><div class='inline'></div></h4> <pre class="example code"> - <span class='const'>D</span> <span class='period'>.</span><span class='op'>&gt;</span> <span class='lbrace'>{</span> <span class='id puts'>puts</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>after each nested test</span><span class='tstring_end'>&quot;</span></span> <span class='rbrace'>}</span> +<span class='const'>D</span> <span class='period'>.</span><span class='op'>&gt;</span> <span class='lbrace'>{</span> <span class='id puts'>puts</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>after each nested test</span><span class='tstring_end'>&quot;</span></span> <span class='rbrace'>}</span> - <span class='const'>D</span> <span class='period'>.</span><span class='op'>&gt;</span> <span class='kw'>do</span> - <span class='id puts'>puts</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>after each nested test</span><span class='tstring_end'>&quot;</span></span> - <span class='kw'>end</span></pre> +<span class='const'>D</span> <span class='period'>.</span><span class='op'>&gt;</span> <span class='kw'>do</span> + <span class='id puts'>puts</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>after each nested test</span><span class='tstring_end'>&quot;</span></span> +<span class='kw'>end</span></pre> </div> <h3>Raises:</h3> <ul class="raise"> @@ -1112,17 +1325,17 @@ <tr> <td> <pre class="lines"> -204 -205 -206 -207</pre> +199 +200 +201 +202</pre> </td> <td> - <pre class="code"><span class="info file"># File 'lib/dfect.rb', line 204</span> + <pre class="code"><span class="info file"># File 'lib/dfect.rb', line 199</span> <span class='kw'>def</span> <span class='op'>&gt;</span> <span class='op'>&amp;</span><span class='id block'>block</span> <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> <span class='ivar'>@suite</span><span class='period'>.</span><span class='id after_each'>after_each</span> <span class='op'>&lt;&lt;</span> <span class='id block'>block</span> <span class='kw'>end</span></pre> @@ -1151,17 +1364,17 @@ <div class="tags"> <div class="examples"> <h3>Examples:</h3> - <h4></h4> + <h4><div class='inline'></div></h4> <pre class="example code"> - <span class='const'>D</span> <span class='period'>.</span><span class='op'>&gt;&gt;</span> <span class='lbrace'>{</span> <span class='id puts'>puts</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>after all nested tests</span><span class='tstring_end'>&quot;</span></span> <span class='rbrace'>}</span> +<span class='const'>D</span> <span class='period'>.</span><span class='op'>&gt;&gt;</span> <span class='lbrace'>{</span> <span class='id puts'>puts</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>after all nested tests</span><span class='tstring_end'>&quot;</span></span> <span class='rbrace'>}</span> - <span class='const'>D</span> <span class='period'>.</span><span class='op'>&gt;&gt;</span> <span class='kw'>do</span> - <span class='id puts'>puts</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>after all nested tests</span><span class='tstring_end'>&quot;</span></span> - <span class='kw'>end</span></pre> +<span class='const'>D</span> <span class='period'>.</span><span class='op'>&gt;&gt;</span> <span class='kw'>do</span> + <span class='id puts'>puts</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>after all nested tests</span><span class='tstring_end'>&quot;</span></span> +<span class='kw'>end</span></pre> </div> <h3>Raises:</h3> <ul class="raise"> @@ -1180,17 +1393,17 @@ <tr> <td> <pre class="lines"> -238 -239 -240 -241</pre> +233 +234 +235 +236</pre> </td> <td> - <pre class="code"><span class="info file"># File 'lib/dfect.rb', line 238</span> + <pre class="code"><span class="info file"># File 'lib/dfect.rb', line 233</span> <span class='kw'>def</span> <span class='op'>&gt;&gt;</span> <span class='op'>&amp;</span><span class='id block'>block</span> <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> <span class='ivar'>@suite</span><span class='period'>.</span><span class='id after_all'>after_all</span> <span class='op'>&lt;&lt;</span> <span class='id block'>block</span> <span class='kw'>end</span></pre> @@ -1218,25 +1431,25 @@ <div class="tags"> <div class="examples"> <h3>Examples:</h3> - <h4> + <h4><div class='inline'><p> no message given - -</h4> +</p> +</div></h4> <pre class="example code"> - <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, =&gt; 123 -</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, =&gt; 456 -</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, =&gt; nil</span></pre> +<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, =&gt; 123 +</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, =&gt; 456 +</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, =&gt; nil</span></pre> - <h4> + <h4><div class='inline'><p> message is given - -</h4> +</p> +</div></h4> <pre class="example code"> - <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'>&quot;</span><span class='tstring_content'>:foo must be thrown</span><span class='tstring_end'>&quot;</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, =&gt; nil</span></pre> +<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'>&quot;</span><span class='tstring_content'>:foo must be thrown</span><span class='tstring_end'>&quot;</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, =&gt; nil</span></pre> </div> <h3>Parameters:</h3> <ul class="param"> @@ -1248,14 +1461,14 @@ <span class='name'>symbol</span> &mdash; - + <div class='inline'><p> Symbol that must be thrown by the given block. - - +</p> +</div> </li> <li> @@ -1267,14 +1480,14 @@ <em class="default">(defaults to: <tt>nil</tt>)</em> &mdash; - + <div class='inline'><p> Optional message to show in the report if this assertion fails. - - +</p> +</div> </li> </ul> <h3>Returns:</h3> @@ -1286,18 +1499,18 @@ - + <div class='inline'><p> If a value is thrown along with the expected symbol, then that value is returned. - - +</p> +<p> Otherwise, nil is returned. - - +</p> +</div> </li> </ul> @@ -1305,16 +1518,16 @@ <tr> <td> <pre class="lines"> -474 -475 -476</pre> +469 +470 +471</pre> </td> <td> - <pre class="code"><span class="info file"># File 'lib/dfect.rb', line 474</span> + <pre class="code"><span class="info file"># File 'lib/dfect.rb', line 469</span> <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'>&amp;</span><span class='id block'>block</span> <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'>&amp;</span><span class='id block'>block</span> <span class='kw'>end</span></pre> </td> @@ -1342,25 +1555,25 @@ <div class="tags"> <div class="examples"> <h3>Examples:</h3> - <h4> + <h4><div class='inline'><p> no message given - -</h4> +</p> +</div></h4> <pre class="example code"> - <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, =&gt; nil -</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, =&gt; nil -</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, =&gt; nil</span></pre> +<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, =&gt; nil +</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, =&gt; nil +</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, =&gt; nil</span></pre> - <h4> + <h4><div class='inline'><p> message is given - -</h4> +</p> +</div></h4> <pre class="example code"> - <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'>&quot;</span><span class='tstring_content'>:foo must be thrown</span><span class='tstring_end'>&quot;</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, =&gt; nil</span></pre> +<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'>&quot;</span><span class='tstring_content'>:foo must be thrown</span><span class='tstring_end'>&quot;</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, =&gt; nil</span></pre> </div> <h3>Parameters:</h3> <ul class="param"> @@ -1372,14 +1585,14 @@ <span class='name'>symbol</span> &mdash; - + <div class='inline'><p> Symbol that must not be thrown by the given block. - - +</p> +</div> </li> <li> @@ -1391,14 +1604,14 @@ <em class="default">(defaults to: <tt>nil</tt>)</em> &mdash; - + <div class='inline'><p> Optional message to show in the report if this assertion fails. - - +</p> +</div> </li> </ul> <h3>Returns:</h3> @@ -1410,14 +1623,14 @@ - + <div class='inline'><p> nil, always. - - +</p> +</div> </li> </ul> @@ -1425,16 +1638,16 @@ <tr> <td> <pre class="lines"> -500 -501 -502</pre> +495 +496 +497</pre> </td> <td> - <pre class="code"><span class="info file"># File 'lib/dfect.rb', line 500</span> + <pre class="code"><span class="info file"># File 'lib/dfect.rb', line 495</span> <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'>&amp;</span><span class='id block'>block</span> <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'>&amp;</span><span class='id block'>block</span> <span class='kw'>end</span></pre> </td> @@ -1462,25 +1675,25 @@ <div class="tags"> <div class="examples"> <h3>Examples:</h3> - <h4> + <h4><div class='inline'><p> no message given - -</h4> +</p> +</div></h4> <pre class="example code"> - <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'># =&gt; true -</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'># =&gt; false -</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'># =&gt; false</span></pre> +<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'># =&gt; true +</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'># =&gt; false +</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'># =&gt; false</span></pre> - <h4> + <h4><div class='inline'><p> message is given - -</h4> +</p> +</div></h4> <pre class="example code"> - <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'>&quot;</span><span class='tstring_content'>:foo must be thrown</span><span class='tstring_end'>&quot;</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'># =&gt; false</span></pre> +<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'>&quot;</span><span class='tstring_content'>:foo must be thrown</span><span class='tstring_end'>&quot;</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'># =&gt; false</span></pre> </div> <h3>Parameters:</h3> <ul class="param"> @@ -1492,14 +1705,14 @@ <span class='name'>symbol</span> &mdash; - + <div class='inline'><p> Symbol that must be thrown by the given block. - - +</p> +</div> </li> <li> @@ -1511,14 +1724,14 @@ <em class="default">(defaults to: <tt>nil</tt>)</em> &mdash; - + <div class='inline'><p> This parameter is optional and completely ignored. - - +</p> +</div> </li> </ul> <h3>Returns:</h3> @@ -1539,16 +1752,16 @@ <tr> <td> <pre class="lines"> -522 -523 -524</pre> +517 +518 +519</pre> </td> <td> - <pre class="code"><span class="info file"># File 'lib/dfect.rb', line 522</span> + <pre class="code"><span class="info file"># File 'lib/dfect.rb', line 517</span> <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'>&amp;</span><span class='id block'>block</span> <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'>&amp;</span><span class='id block'>block</span> <span class='kw'>end</span></pre> </td> @@ -1583,27 +1796,27 @@ <div class="tags"> <div class="examples"> <h3>Examples:</h3> - <h4></h4> + <h4><div class='inline'></div></h4> <pre class="example code"> - <span class='const'>D</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>a new array</span><span class='tstring_end'>&quot;</span></span> <span class='kw'>do</span> - <span class='const'>D</span> <span class='period'>.</span><span class='op'>&lt;</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> +<span class='const'>D</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>a new array</span><span class='tstring_end'>&quot;</span></span> <span class='kw'>do</span> + <span class='const'>D</span> <span class='period'>.</span><span class='op'>&lt;</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> - <span class='const'>D</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>must be empty</span><span class='tstring_end'>&quot;</span></span> <span class='kw'>do</span> - <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> - <span class='kw'>end</span> + <span class='const'>D</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>must be empty</span><span class='tstring_end'>&quot;</span></span> <span class='kw'>do</span> + <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> + <span class='kw'>end</span> - <span class='const'>D</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>when populated</span><span class='tstring_end'>&quot;</span></span> <span class='kw'>do</span> - <span class='const'>D</span> <span class='period'>.</span><span class='op'>&lt;</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> + <span class='const'>D</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>when populated</span><span class='tstring_end'>&quot;</span></span> <span class='kw'>do</span> + <span class='const'>D</span> <span class='period'>.</span><span class='op'>&lt;</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> - <span class='const'>D</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>must not be empty</span><span class='tstring_end'>&quot;</span></span> <span class='kw'>do</span> - <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> - <span class='kw'>end</span> + <span class='const'>D</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>must not be empty</span><span class='tstring_end'>&quot;</span></span> <span class='kw'>do</span> + <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> <span class='kw'>end</span> - <span class='kw'>end</span></pre> + <span class='kw'>end</span> +<span class='kw'>end</span></pre> </div> <h3>Parameters:</h3> <ul class="param"> @@ -1615,14 +1828,14 @@ <span class='name'>description</span> &mdash; - + <div class='inline'><p> A brief title or a series of objects that describe the test being defined. - - +</p> +</div> </li> </ul> @@ -1630,16 +1843,16 @@ <tr> <td> <pre class="lines"> -127 -128 -129</pre> +122 +123 +124</pre> </td> <td> - <pre class="code"><span class="info file"># File 'lib/dfect.rb', line 127</span> + <pre class="code"><span class="info file"># File 'lib/dfect.rb', line 122</span> <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'>&amp;</span><span class='id block'>block</span> <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'>&amp;</span><span class='id block'>block</span> <span class='kw'>end</span></pre> </td> @@ -1670,34 +1883,34 @@ <div class="tags"> <div class="examples"> <h3>Examples:</h3> - <h4></h4> + <h4><div class='inline'></div></h4> <pre class="example code"> - <span class='const'>D</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>a root-level test</span><span class='tstring_end'>&quot;</span></span> <span class='kw'>do</span> - <span class='ivar'>@outside</span> <span class='op'>=</span> <span class='int'>1</span> +<span class='const'>D</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>a root-level test</span><span class='tstring_end'>&quot;</span></span> <span class='kw'>do</span> + <span class='ivar'>@outside</span> <span class='op'>=</span> <span class='int'>1</span> + <span class='const'>T</span> <span class='lbrace'>{</span> <span class='kw'>defined?</span> <span class='ivar'>@outside</span> <span class='rbrace'>}</span> + <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> + + <span class='const'>D</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>an inner, non-insulated test</span><span class='tstring_end'>&quot;</span></span> <span class='kw'>do</span> <span class='const'>T</span> <span class='lbrace'>{</span> <span class='kw'>defined?</span> <span class='ivar'>@outside</span> <span class='rbrace'>}</span> <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> + <span class='kw'>end</span> - <span class='const'>D</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>an inner, non-insulated test</span><span class='tstring_end'>&quot;</span></span> <span class='kw'>do</span> - <span class='const'>T</span> <span class='lbrace'>{</span> <span class='kw'>defined?</span> <span class='ivar'>@outside</span> <span class='rbrace'>}</span> - <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> - <span class='kw'>end</span> + <span class='id D!'>D!</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>an inner, insulated test</span><span class='tstring_end'>&quot;</span></span> <span class='kw'>do</span> + <span class='const'>F</span> <span class='lbrace'>{</span> <span class='kw'>defined?</span> <span class='ivar'>@outside</span> <span class='rbrace'>}</span> + <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> - <span class='id D!'>D!</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>an inner, insulated test</span><span class='tstring_end'>&quot;</span></span> <span class='kw'>do</span> - <span class='const'>F</span> <span class='lbrace'>{</span> <span class='kw'>defined?</span> <span class='ivar'>@outside</span> <span class='rbrace'>}</span> - <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> + <span class='ivar'>@inside</span> <span class='op'>=</span> <span class='int'>2</span> + <span class='const'>T</span> <span class='lbrace'>{</span> <span class='kw'>defined?</span> <span class='ivar'>@inside</span> <span class='rbrace'>}</span> + <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> + <span class='kw'>end</span> - <span class='ivar'>@inside</span> <span class='op'>=</span> <span class='int'>2</span> - <span class='const'>T</span> <span class='lbrace'>{</span> <span class='kw'>defined?</span> <span class='ivar'>@inside</span> <span class='rbrace'>}</span> - <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> - <span class='kw'>end</span> - - <span class='const'>F</span> <span class='lbrace'>{</span> <span class='kw'>defined?</span> <span class='ivar'>@inside</span> <span class='rbrace'>}</span> - <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> - <span class='kw'>end</span></pre> + <span class='const'>F</span> <span class='lbrace'>{</span> <span class='kw'>defined?</span> <span class='ivar'>@inside</span> <span class='rbrace'>}</span> + <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> +<span class='kw'>end</span></pre> </div> <h3>Parameters:</h3> <ul class="param"> @@ -1709,14 +1922,14 @@ <span class='name'>description</span> &mdash; - + <div class='inline'><p> A brief title or a series of objects that describe the test being defined. - - +</p> +</div> </li> </ul> @@ -1724,16 +1937,16 @@ <tr> <td> <pre class="lines"> -164 -165 -166</pre> +159 +160 +161</pre> </td> <td> - <pre class="code"><span class="info file"># File 'lib/dfect.rb', line 164</span> + <pre class="code"><span class="info file"># File 'lib/dfect.rb', line 159</span> <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'>&amp;</span><span class='id block'>block</span> <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'>&amp;</span><span class='id block'>block</span> <span class='kw'>end</span></pre> </td> @@ -1761,33 +1974,33 @@ <div class="tags"> <div class="examples"> <h3>Examples:</h3> - <h4> + <h4><div class='inline'><p> no exceptions given - -</h4> +</p> +</div></h4> <pre class="example code"> - <span class='const'>E</span> <span class='lbrace'>{</span> <span class='rbrace'>}</span> <span class='comment'># fails -</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> +<span class='const'>E</span> <span class='lbrace'>{</span> <span class='rbrace'>}</span> <span class='comment'># fails +</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> - <h4> + <h4><div class='inline'><p> single exception given - -</h4> +</p> +</div></h4> <pre class="example code"> - <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> - <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'>&quot;</span><span class='tstring_content'>argument must be invalid</span><span class='tstring_end'>&quot;</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> +<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> +<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'>&quot;</span><span class='tstring_content'>argument must be invalid</span><span class='tstring_end'>&quot;</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> - <h4> + <h4><div class='inline'><p> multiple exceptions given - -</h4> +</p> +</div></h4> <pre class="example code"> - <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'>&quot;</span><span class='tstring_content'>...</span><span class='tstring_end'>&quot;</span></span> <span class='rbrace'>}</span> - <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'>&quot;</span><span class='tstring_content'>string must compile</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span> <span class='lbrace'>{</span> <span class='id eval'>eval</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>...</span><span class='tstring_end'>&quot;</span></span> <span class='rbrace'>}</span></pre> +<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'>&quot;</span><span class='tstring_content'>...</span><span class='tstring_end'>&quot;</span></span> <span class='rbrace'>}</span> +<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'>&quot;</span><span class='tstring_content'>string must compile</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span> <span class='lbrace'>{</span> <span class='id eval'>eval</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>...</span><span class='tstring_end'>&quot;</span></span> <span class='rbrace'>}</span></pre> </div> <h3>Parameters:</h3> <ul class="param"> @@ -1799,20 +2012,20 @@ <span class='name'>kinds_then_message</span> &mdash; - + <div class='inline'><p> Exception classes that must be raised by the given block, optionally followed by a message to show in the report if this assertion fails. - - +</p> +<p> If no exception classes are given, then StandardError is assumed (similar to how a plain &#8216;rescue&#8217; statement without any arguments catches StandardError). - - +</p> +</div> </li> </ul> <h3>Returns:</h3> @@ -1824,17 +2037,17 @@ - + <div class='inline'><p> If the block raises an exception, then that exception is returned. - - +</p> +<p> Otherwise, nil is returned. - - +</p> +</div> </li> </ul> @@ -1842,16 +2055,16 @@ <tr> <td> <pre class="lines"> -381 -382 -383</pre> +376 +377 +378</pre> </td> <td> - <pre class="code"><span class="info file"># File 'lib/dfect.rb', line 381</span> + <pre class="code"><span class="info file"># File 'lib/dfect.rb', line 376</span> <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'>&amp;</span><span class='id block'>block</span> <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'>&amp;</span><span class='id block'>block</span> <span class='kw'>end</span></pre> </td> @@ -1879,33 +2092,33 @@ <div class="tags"> <div class="examples"> <h3>Examples:</h3> - <h4> + <h4><div class='inline'><p> no exceptions given - -</h4> +</p> +</div></h4> <pre class="example code"> - <span class='id E!'>E!</span> <span class='lbrace'>{</span> <span class='rbrace'>}</span> <span class='comment'># passes -</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> +<span class='id E!'>E!</span> <span class='lbrace'>{</span> <span class='rbrace'>}</span> <span class='comment'># passes +</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> - <h4> + <h4><div class='inline'><p> single exception given - -</h4> +</p> +</div></h4> <pre class="example code"> - <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 -</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'>&quot;</span><span class='tstring_content'>argument must be invalid</span><span class='tstring_end'>&quot;</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> +<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 +</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'>&quot;</span><span class='tstring_content'>argument must be invalid</span><span class='tstring_end'>&quot;</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> - <h4> + <h4><div class='inline'><p> multiple exceptions given - -</h4> +</p> +</div></h4> <pre class="example code"> - <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'>&quot;</span><span class='tstring_content'>...</span><span class='tstring_end'>&quot;</span></span> <span class='rbrace'>}</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'>&quot;</span><span class='tstring_content'>string must compile</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span> <span class='lbrace'>{</span> <span class='id eval'>eval</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>...</span><span class='tstring_end'>&quot;</span></span> <span class='rbrace'>}</span></pre> +<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'>&quot;</span><span class='tstring_content'>...</span><span class='tstring_end'>&quot;</span></span> <span class='rbrace'>}</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'>&quot;</span><span class='tstring_content'>string must compile</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span> <span class='lbrace'>{</span> <span class='id eval'>eval</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>...</span><span class='tstring_end'>&quot;</span></span> <span class='rbrace'>}</span></pre> </div> <h3>Parameters:</h3> <ul class="param"> @@ -1917,20 +2130,20 @@ <span class='name'>kinds_then_message</span> &mdash; - + <div class='inline'><p> Exception classes that must be raised by the given block, optionally followed by a message to show in the report if this assertion fails. - - +</p> +<p> If no exception classes are given, then StandardError is assumed (similar to how a plain &#8216;rescue&#8217; statement without any arguments catches StandardError). - - +</p> +</div> </li> </ul> <h3>Returns:</h3> @@ -1942,17 +2155,17 @@ - + <div class='inline'><p> If the block raises an exception, then that exception is returned. - - +</p> +<p> Otherwise, nil is returned. - - +</p> +</div> </li> </ul> @@ -1960,16 +2173,16 @@ <tr> <td> <pre class="lines"> -408 -409 -410</pre> +403 +404 +405</pre> </td> <td> - <pre class="code"><span class="info file"># File 'lib/dfect.rb', line 408</span> + <pre class="code"><span class="info file"># File 'lib/dfect.rb', line 403</span> <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'>&amp;</span><span class='id block'>block</span> <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'>&amp;</span><span class='id block'>block</span> <span class='kw'>end</span></pre> </td> @@ -1997,32 +2210,32 @@ <div class="tags"> <div class="examples"> <h3>Examples:</h3> - <h4> + <h4><div class='inline'><p> no exceptions given - -</h4> +</p> +</div></h4> <pre class="example code"> - <span class='id E?'>E?</span> <span class='lbrace'>{</span> <span class='rbrace'>}</span> <span class='comment'># =&gt; false -</span> <span class='id E?'>E?</span> <span class='lbrace'>{</span> <span class='id raise'>raise</span> <span class='rbrace'>}</span> <span class='comment'># =&gt; true</span></pre> +<span class='id E?'>E?</span> <span class='lbrace'>{</span> <span class='rbrace'>}</span> <span class='comment'># =&gt; false +</span><span class='id E?'>E?</span> <span class='lbrace'>{</span> <span class='id raise'>raise</span> <span class='rbrace'>}</span> <span class='comment'># =&gt; true</span></pre> - <h4> + <h4><div class='inline'><p> single exception given - -</h4> +</p> +</div></h4> <pre class="example code"> - <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'># =&gt; true</span></pre> +<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'># =&gt; true</span></pre> - <h4> + <h4><div class='inline'><p> multiple exceptions given - -</h4> +</p> +</div></h4> <pre class="example code"> - <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'>&quot;</span><span class='tstring_content'>...</span><span class='tstring_end'>&quot;</span></span> <span class='rbrace'>}</span> <span class='comment'># =&gt; true -</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'>&quot;</span><span class='tstring_content'>string must compile</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span> <span class='lbrace'>{</span> <span class='id eval'>eval</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>...</span><span class='tstring_end'>&quot;</span></span> <span class='rbrace'>}</span></pre> +<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'>&quot;</span><span class='tstring_content'>...</span><span class='tstring_end'>&quot;</span></span> <span class='rbrace'>}</span> <span class='comment'># =&gt; true +</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'>&quot;</span><span class='tstring_content'>string must compile</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span> <span class='lbrace'>{</span> <span class='id eval'>eval</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>...</span><span class='tstring_end'>&quot;</span></span> <span class='rbrace'>}</span></pre> </div> <h3>Parameters:</h3> <ul class="param"> @@ -2034,20 +2247,20 @@ <span class='name'>kinds_then_message</span> &mdash; - + <div class='inline'><p> Exception classes that must be raised by the given block, optionally followed by a message that is completely ignored. - - +</p> +<p> If no exception classes are given, then StandardError is assumed (similar to how a plain &#8216;rescue&#8217; statement without any arguments catches StandardError). - - +</p> +</div> </li> </ul> <h3>Returns:</h3> @@ -2068,16 +2281,16 @@ <tr> <td> <pre class="lines"> -442 -443 -444</pre> +437 +438 +439</pre> </td> <td> - <pre class="code"><span class="info file"># File 'lib/dfect.rb', line 442</span> + <pre class="code"><span class="info file"># File 'lib/dfect.rb', line 437</span> <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'>&amp;</span><span class='id block'>block</span> <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'>&amp;</span><span class='id block'>block</span> <span class='kw'>end</span></pre> </td> @@ -2105,25 +2318,25 @@ <div class="tags"> <div class="examples"> <h3>Examples:</h3> - <h4> + <h4><div class='inline'><p> no message given - -</h4> +</p> +</div></h4> <pre class="example code"> - <span class='id F?'>F?</span> <span class='lbrace'>{</span> <span class='kw'>true</span> <span class='rbrace'>}</span> <span class='comment'># =&gt; false -</span> <span class='id F?'>F?</span> <span class='lbrace'>{</span> <span class='kw'>false</span> <span class='rbrace'>}</span> <span class='comment'># =&gt; true -</span> <span class='id F?'>F?</span> <span class='lbrace'>{</span> <span class='kw'>nil</span> <span class='rbrace'>}</span> <span class='comment'># =&gt; true</span></pre> +<span class='id F?'>F?</span> <span class='lbrace'>{</span> <span class='kw'>true</span> <span class='rbrace'>}</span> <span class='comment'># =&gt; false +</span><span class='id F?'>F?</span> <span class='lbrace'>{</span> <span class='kw'>false</span> <span class='rbrace'>}</span> <span class='comment'># =&gt; true +</span><span class='id F?'>F?</span> <span class='lbrace'>{</span> <span class='kw'>nil</span> <span class='rbrace'>}</span> <span class='comment'># =&gt; true</span></pre> - <h4> + <h4><div class='inline'><p> message is given - -</h4> +</p> +</div></h4> <pre class="example code"> - <span class='id F?'>F?</span><span class='lparen'>(</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>computers do not doublethink</span><span class='tstring_end'>&quot;</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'># =&gt; true</span></pre> +<span class='id F?'>F?</span><span class='lparen'>(</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>computers do not doublethink</span><span class='tstring_end'>&quot;</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'># =&gt; true</span></pre> </div> <h3>Parameters:</h3> <ul class="param"> @@ -2137,14 +2350,14 @@ <em class="default">(defaults to: <tt>nil</tt>)</em> &mdash; - + <div class='inline'><p> This parameter is optional and completely ignored. - - +</p> +</div> </li> </ul> <h3>Returns:</h3> @@ -2165,16 +2378,16 @@ <tr> <td> <pre class="lines"> -340 -341 -342</pre> +335 +336 +337</pre> </td> <td> - <pre class="code"><span class="info file"># File 'lib/dfect.rb', line 340</span> + <pre class="code"><span class="info file"># File 'lib/dfect.rb', line 335</span> <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'>&amp;</span><span class='id block'>block</span> <span class='kw'>not</span> <span class='id T?'>T?</span> <span class='id message'>message</span><span class='comma'>,</span> <span class='op'>&amp;</span><span class='id block'>block</span> <span class='kw'>end</span></pre> </td> @@ -2205,16 +2418,16 @@ <tr> <td> <pre class="lines"> -680 -681 -682</pre> +675 +676 +677</pre> </td> <td> - <pre class="code"><span class="info file"># File 'lib/dfect.rb', line 680</span> + <pre class="code"><span class="info file"># File 'lib/dfect.rb', line 675</span> <span class='kw'>def</span> <span class='id info'>info</span> <span class='ivar'>@trace</span><span class='period'>.</span><span class='id last'>last</span> <span class='kw'>end</span></pre> </td> @@ -2227,11 +2440,22 @@ + (<tt><a href="Object.html" title="Object (class)">Object</a></tt>) <strong>inspect</strong> -</p><table class="source_code"> +</p><div class="docstring"> + <div class="discussion"> + <p> +Description of this release of this project. +</p> + + + </div> +</div> +<div class="tags"> + +</div><table class="source_code"> <tr> <td> <pre class="lines"> @@ -2241,11 +2465,11 @@ </td> <td> <pre class="code"><span class="info file"># File 'lib/dfect/inochi.rb', line 31</span> <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id inspect'>inspect</span> - <span class='tstring'><span class='tstring_beg'>&quot;</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'>RELEASE</span><span class='rbrace'>}</span><span class='tstring_content'>)</span><span class='tstring_end'>&quot;</span></span> + <span class='tstring'><span class='tstring_beg'>&quot;</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'>&quot;</span></span> <span class='kw'>end</span></pre> </td> </tr> </table> </div> @@ -2273,23 +2497,23 @@ <div class="tags"> <div class="examples"> <h3>Examples:</h3> - <h4> + <h4><div class='inline'><p> single message given - -</h4> +</p> +</div></h4> <pre class="example code"> - <span class='const'>L</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>establishing connection...</span><span class='tstring_end'>&quot;</span></span></pre> +<span class='const'>L</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>establishing connection...</span><span class='tstring_end'>&quot;</span></span></pre> - <h4> + <h4><div class='inline'><p> multiple messages given - -</h4> +</p> +</div></h4> <pre class="example code"> - <span class='const'>L</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>beginning calculation...</span><span class='tstring_end'>&quot;</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> +<span class='const'>L</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>beginning calculation...</span><span class='tstring_end'>&quot;</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> </div> <h3>Parameters:</h3> <ul class="param"> @@ -2301,14 +2525,14 @@ <span class='name'>messages</span> &mdash; - + <div class='inline'><p> Objects to be added to the report. - - +</p> +</div> </li> </ul> @@ -2316,26 +2540,93 @@ <tr> <td> <pre class="lines"> -544 -545 -546</pre> +539 +540 +541</pre> </td> <td> - <pre class="code"><span class="info file"># File 'lib/dfect.rb', line 544</span> + <pre class="code"><span class="info file"># File 'lib/dfect.rb', line 539</span> <span class='kw'>def</span> <span class='const'>L</span> <span class='op'>*</span><span class='id messages'>messages</span> <span class='ivar'>@trace</span><span class='period'>.</span><span class='id concat'>concat</span> <span class='id messages'>messages</span> <span class='kw'>end</span></pre> </td> </tr> </table> </div> <div class="method_details "> + <p class="signature " id="require-class_method"> + + + (<tt><a href="Object.html" title="Object (class)">Object</a></tt>) <strong>require</strong>(gem_name_or_library) + + + +</p><div class="docstring"> + <div class="discussion"> + <p> +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> +constant in this module) of the given gem or the gem that contains the +given library. +</p> + + + </div> +</div> +<div class="tags"> + +</div><table class="source_code"> + <tr> + <td> + <pre class="lines"> + + +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100</pre> + </td> + <td> + <pre class="code"><span class="info file"># File 'lib/dfect/inochi.rb', line 85</span> + +<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> + <span class='comment'># prepare the correct version of the gem for loading +</span> <span class='kw'>if</span> <span class='id respond_to?'>respond_to?</span> <span class='symbol'>:gem</span> + <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> + <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> + <span class='kw'>begin</span> + <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> + <span class='kw'>rescue</span> <span class='const'>LoadError</span> <span class='op'>=&gt;</span> <span class='id error'>error</span> + <span class='id warn'>warn</span> <span class='tstring'><span class='tstring_beg'>&quot;</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'>&quot;</span></span> + <span class='kw'>end</span> + <span class='kw'>end</span> + <span class='kw'>end</span> + + <span class='comment'># do the loading +</span> <span class='kw'>super</span> +<span class='kw'>end</span></pre> + </td> + </tr> +</table> +</div> + + <div class="method_details "> <p class="signature " id="run-class_method"> + (<tt><a href="Object.html" title="Object (class)">Object</a></tt>) <strong>run</strong>(continue = true) @@ -2364,14 +2655,14 @@ <em class="default">(defaults to: <tt>true</tt>)</em> &mdash; - + <div class='inline'><p> If true, results from previous executions will not be cleared. - - +</p> +</div> </li> </ul> @@ -2379,10 +2670,15 @@ <tr> <td> <pre class="lines"> +636 +637 +638 +639 +640 641 642 643 644 645 @@ -2399,19 +2695,14 @@ 656 657 658 659 660 -661 -662 -663 -664 -665 -666</pre> +661</pre> </td> <td> - <pre class="code"><span class="info file"># File 'lib/dfect.rb', line 641</span> + <pre class="code"><span class="info file"># File 'lib/dfect.rb', line 636</span> <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> <span class='comment'># clear previous results </span> <span class='kw'>unless</span> <span class='id continue'>continue</span> <span class='ivar'>@stats</span><span class='period'>.</span><span class='id clear'>clear</span> @@ -2467,23 +2758,23 @@ <div class="tags"> <div class="examples"> <h3>Examples:</h3> - <h4></h4> + <h4><div class='inline'></div></h4> <pre class="example code"> - <span class='const'>S</span> <span class='symbol'>:knowledge</span> <span class='kw'>do</span> - <span class='comment'>#... -</span> <span class='kw'>end</span> +<span class='const'>S</span> <span class='symbol'>:knowledge</span> <span class='kw'>do</span> + <span class='comment'>#... +</span><span class='kw'>end</span> - <span class='const'>D</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>some test</span><span class='tstring_end'>&quot;</span></span> <span class='kw'>do</span> - <span class='const'>S</span> <span class='symbol'>:knowledge</span> - <span class='kw'>end</span> +<span class='const'>D</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>some test</span><span class='tstring_end'>&quot;</span></span> <span class='kw'>do</span> + <span class='const'>S</span> <span class='symbol'>:knowledge</span> +<span class='kw'>end</span> - <span class='const'>D</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>another test</span><span class='tstring_end'>&quot;</span></span> <span class='kw'>do</span> - <span class='const'>S</span> <span class='symbol'>:knowledge</span> - <span class='kw'>end</span></pre> +<span class='const'>D</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>another test</span><span class='tstring_end'>&quot;</span></span> <span class='kw'>do</span> + <span class='const'>S</span> <span class='symbol'>:knowledge</span> +<span class='kw'>end</span></pre> </div> <h3>Parameters:</h3> <ul class="param"> @@ -2495,15 +2786,15 @@ <span class='name'>identifier</span> &mdash; - + <div class='inline'><p> An object that identifies shared code. This must be common knowledge to all parties that want to partake in the sharing. - - +</p> +</div> </li> </ul> @@ -2511,10 +2802,15 @@ <tr> <td> <pre class="lines"> +572 +573 +574 +575 +576 577 578 579 580 581 @@ -2527,19 +2823,14 @@ 588 589 590 591 592 -593 -594 -595 -596 -597 -598</pre> +593</pre> </td> <td> - <pre class="code"><span class="info file"># File 'lib/dfect.rb', line 577</span> + <pre class="code"><span class="info file"># File 'lib/dfect.rb', line 572</span> <span class='kw'>def</span> <span class='const'>S</span> <span class='id identifier'>identifier</span><span class='comma'>,</span> <span class='op'>&amp;</span><span class='id block'>block</span> <span class='kw'>if</span> <span class='id block_given?'>block_given?</span> <span class='kw'>if</span> <span class='id already_shared'>already_shared</span> <span class='op'>=</span> <span class='ivar'>@share</span><span class='lbracket'>[</span><span class='id identifier'>identifier</span><span class='rbracket'>]</span> <span class='id raise'>raise</span> <span class='const'>ArgumentError</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>A code block </span><span class='embexpr_beg'>#{</span><span class='id already_shared'>already_shared</span><span class='period'>.</span><span class='id inspect'>inspect</span><span class='rbrace'>}</span><span class='tstring_content'> has already been shared under the identifier </span><span class='embexpr_beg'>#{</span><span class='id identifier'>identifier</span><span class='period'>.</span><span class='id inspect'>inspect</span><span class='rbrace'>}</span><span class='tstring_content'>.</span><span class='tstring_end'>&quot;</span></span> @@ -2587,21 +2878,21 @@ <div class="tags"> <div class="examples"> <h3>Examples:</h3> - <h4></h4> + <h4><div class='inline'></div></h4> <pre class="example code"> - <span class='const'>D</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>some test</span><span class='tstring_end'>&quot;</span></span> <span class='kw'>do</span> - <span class='id S!'>S!</span> <span class='symbol'>:knowledge</span> <span class='kw'>do</span> - <span class='comment'>#... -</span> <span class='kw'>end</span> - <span class='kw'>end</span> +<span class='const'>D</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>some test</span><span class='tstring_end'>&quot;</span></span> <span class='kw'>do</span> + <span class='id S!'>S!</span> <span class='symbol'>:knowledge</span> <span class='kw'>do</span> + <span class='comment'>#... +</span> <span class='kw'>end</span> +<span class='kw'>end</span> - <span class='const'>D</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>another test</span><span class='tstring_end'>&quot;</span></span> <span class='kw'>do</span> - <span class='const'>S</span> <span class='symbol'>:knowledge</span> - <span class='kw'>end</span></pre> +<span class='const'>D</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>another test</span><span class='tstring_end'>&quot;</span></span> <span class='kw'>do</span> + <span class='const'>S</span> <span class='symbol'>:knowledge</span> +<span class='kw'>end</span></pre> </div> <h3>Parameters:</h3> <ul class="param"> @@ -2613,15 +2904,15 @@ <span class='name'>identifier</span> &mdash; - + <div class='inline'><p> An object that identifies shared code. This must be common knowledge to all parties that want to partake in the sharing. - - +</p> +</div> </li> </ul> @@ -2629,18 +2920,18 @@ <tr> <td> <pre class="lines"> -620 -621 -622 -623 -624</pre> +615 +616 +617 +618 +619</pre> </td> <td> - <pre class="code"><span class="info file"># File 'lib/dfect.rb', line 620</span> + <pre class="code"><span class="info file"># File 'lib/dfect.rb', line 615</span> <span class='kw'>def</span> <span class='id S!'>S!</span> <span class='id identifier'>identifier</span><span class='comma'>,</span> <span class='op'>&amp;</span><span class='id block'>block</span> <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> <span class='const'>S</span> <span class='id identifier'>identifier</span><span class='comma'>,</span> <span class='op'>&amp;</span><span class='id block'>block</span> <span class='const'>S</span> <span class='id identifier'>identifier</span> @@ -2685,16 +2976,16 @@ <tr> <td> <pre class="lines"> -629 -630 -631</pre> +624 +625 +626</pre> </td> <td> - <pre class="code"><span class="info file"># File 'lib/dfect.rb', line 629</span> + <pre class="code"><span class="info file"># File 'lib/dfect.rb', line 624</span> <span class='kw'>def</span> <span class='id S?'>S?</span> <span class='id identifier'>identifier</span> <span class='ivar'>@share</span><span class='period'>.</span><span class='id key?'>key?</span> <span class='id identifier'>identifier</span> <span class='kw'>end</span></pre> </td> @@ -2725,16 +3016,16 @@ <tr> <td> <pre class="lines"> -672 -673 -674</pre> +667 +668 +669</pre> </td> <td> - <pre class="code"><span class="info file"># File 'lib/dfect.rb', line 672</span> + <pre class="code"><span class="info file"># File 'lib/dfect.rb', line 667</span> <span class='kw'>def</span> <span class='id stop'>stop</span> <span class='id throw'>throw</span> <span class='symbol'>:stop_dfect_execution</span> <span class='kw'>end</span></pre> </td> @@ -2766,25 +3057,25 @@ <div class="tags"> <div class="examples"> <h3>Examples:</h3> - <h4> + <h4><div class='inline'><p> no message given - -</h4> +</p> +</div></h4> <pre class="example code"> - <span class='const'>T</span> <span class='lbrace'>{</span> <span class='kw'>true</span> <span class='rbrace'>}</span> <span class='comment'># passes -</span> <span class='const'>T</span> <span class='lbrace'>{</span> <span class='kw'>false</span> <span class='rbrace'>}</span> <span class='comment'># fails -</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> +<span class='const'>T</span> <span class='lbrace'>{</span> <span class='kw'>true</span> <span class='rbrace'>}</span> <span class='comment'># passes +</span><span class='const'>T</span> <span class='lbrace'>{</span> <span class='kw'>false</span> <span class='rbrace'>}</span> <span class='comment'># fails +</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> - <h4> + <h4><div class='inline'><p> message is given - -</h4> +</p> +</div></h4> <pre class="example code"> - <span class='const'>T</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>computers do not doublethink</span><span class='tstring_end'>&quot;</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> +<span class='const'>T</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>computers do not doublethink</span><span class='tstring_end'>&quot;</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> </div> <h3>Parameters:</h3> <ul class="param"> @@ -2798,15 +3089,15 @@ <em class="default">(defaults to: <tt>nil</tt>)</em> &mdash; - + <div class='inline'><p> The condition to be asserted. A block may be given in place of this parameter. - - +</p> +</div> </li> <li> @@ -2818,14 +3109,14 @@ <em class="default">(defaults to: <tt>nil</tt>)</em> &mdash; - + <div class='inline'><p> Optional message to show in the report if this assertion fails. - - +</p> +</div> </li> </ul> @@ -2833,16 +3124,16 @@ <tr> <td> <pre class="lines"> -268 -269 -270</pre> +263 +264 +265</pre> </td> <td> - <pre class="code"><span class="info file"># File 'lib/dfect.rb', line 268</span> + <pre class="code"><span class="info file"># File 'lib/dfect.rb', line 263</span> <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'>&amp;</span><span class='id block'>block</span> <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'>&amp;</span><span class='id block'>block</span> <span class='kw'>end</span></pre> </td> @@ -2874,25 +3165,25 @@ <div class="tags"> <div class="examples"> <h3>Examples:</h3> - <h4> + <h4><div class='inline'><p> no message given - -</h4> +</p> +</div></h4> <pre class="example code"> - <span class='id T!'>T!</span> <span class='lbrace'>{</span> <span class='kw'>true</span> <span class='rbrace'>}</span> <span class='comment'># fails -</span> <span class='id T!'>T!</span> <span class='lbrace'>{</span> <span class='kw'>false</span> <span class='rbrace'>}</span> <span class='comment'># passes -</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> +<span class='id T!'>T!</span> <span class='lbrace'>{</span> <span class='kw'>true</span> <span class='rbrace'>}</span> <span class='comment'># fails +</span><span class='id T!'>T!</span> <span class='lbrace'>{</span> <span class='kw'>false</span> <span class='rbrace'>}</span> <span class='comment'># passes +</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> - <h4> + <h4><div class='inline'><p> message is given - -</h4> +</p> +</div></h4> <pre class="example code"> - <span class='id T!'>T!</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>computers do not doublethink</span><span class='tstring_end'>&quot;</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> +<span class='id T!'>T!</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>computers do not doublethink</span><span class='tstring_end'>&quot;</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> </div> <h3>Parameters:</h3> <ul class="param"> @@ -2906,15 +3197,15 @@ <em class="default">(defaults to: <tt>nil</tt>)</em> &mdash; - + <div class='inline'><p> The condition to be asserted. A block may be given in place of this parameter. - - +</p> +</div> </li> <li> @@ -2926,14 +3217,14 @@ <em class="default">(defaults to: <tt>nil</tt>)</em> &mdash; - + <div class='inline'><p> Optional message to show in the report if this assertion fails. - - +</p> +</div> </li> </ul> @@ -2941,16 +3232,16 @@ <tr> <td> <pre class="lines"> -291 -292 -293</pre> +286 +287 +288</pre> </td> <td> - <pre class="code"><span class="info file"># File 'lib/dfect.rb', line 291</span> + <pre class="code"><span class="info file"># File 'lib/dfect.rb', line 286</span> <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'>&amp;</span><span class='id block'>block</span> <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'>&amp;</span><span class='id block'>block</span> <span class='kw'>end</span></pre> </td> @@ -2978,25 +3269,25 @@ <div class="tags"> <div class="examples"> <h3>Examples:</h3> - <h4> + <h4><div class='inline'><p> no message given - -</h4> +</p> +</div></h4> <pre class="example code"> - <span class='id T?'>T?</span> <span class='lbrace'>{</span> <span class='kw'>true</span> <span class='rbrace'>}</span> <span class='comment'># =&gt; true -</span> <span class='id T?'>T?</span> <span class='lbrace'>{</span> <span class='kw'>false</span> <span class='rbrace'>}</span> <span class='comment'># =&gt; false -</span> <span class='id T?'>T?</span> <span class='lbrace'>{</span> <span class='kw'>nil</span> <span class='rbrace'>}</span> <span class='comment'># =&gt; false</span></pre> +<span class='id T?'>T?</span> <span class='lbrace'>{</span> <span class='kw'>true</span> <span class='rbrace'>}</span> <span class='comment'># =&gt; true +</span><span class='id T?'>T?</span> <span class='lbrace'>{</span> <span class='kw'>false</span> <span class='rbrace'>}</span> <span class='comment'># =&gt; false +</span><span class='id T?'>T?</span> <span class='lbrace'>{</span> <span class='kw'>nil</span> <span class='rbrace'>}</span> <span class='comment'># =&gt; false</span></pre> - <h4> + <h4><div class='inline'><p> message is given - -</h4> +</p> +</div></h4> <pre class="example code"> - <span class='id T?'>T?</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>computers do not doublethink</span><span class='tstring_end'>&quot;</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'># =&gt; true</span></pre> +<span class='id T?'>T?</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>computers do not doublethink</span><span class='tstring_end'>&quot;</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'># =&gt; true</span></pre> </div> <h3>Parameters:</h3> <ul class="param"> @@ -3010,14 +3301,14 @@ <em class="default">(defaults to: <tt>nil</tt>)</em> &mdash; - + <div class='inline'><p> This parameter is optional and completely ignored. - - +</p> +</div> </li> <li> @@ -3029,15 +3320,15 @@ <em class="default">(defaults to: <tt>nil</tt>)</em> &mdash; - + <div class='inline'><p> The condition to be asserted. A block may be given in place of this parameter. - - +</p> +</div> </li> </ul> <h3>Returns:</h3> @@ -3058,16 +3349,16 @@ <tr> <td> <pre class="lines"> -316 -317 -318</pre> +311 +312 +313</pre> </td> <td> - <pre class="code"><span class="info file"># File 'lib/dfect.rb', line 316</span> + <pre class="code"><span class="info file"># File 'lib/dfect.rb', line 311</span> <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'>&amp;</span><span class='id block'>block</span> <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'>&amp;</span><span class='id block'>block</span> <span class='kw'>end</span></pre> </td> @@ -3168,12 +3459,12 @@ </div> </div> <div id="footer"> - Generated on Sun Mar 21 16:21:52 2010 by + Generated on Wed Mar 31 23:33:35 2010 by <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool">yard</a> - 0.5.3 (ruby-1.9.1). + 0.5.4 (ruby-1.9.1). </div> </body> </html> \ No newline at end of file