<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”> <html lang=‘en’ xml:lang=‘en’ xmlns=‘www.w3.org/1999/xhtml’>

<head>
  <title>rcov/ruby/1.8/gems/rspec-core-2.5.1/lib/rspec/core/extensions/module_eval_with_args.rb</title>
  <link href="screen.css" media="all" rel="stylesheet" type="text/css" />
  <link href="print.css" media="print" rel="stylesheet" type="text/css" />

  <meta http-equiv="Content-type" content="text/html;charset=UTF-8" />
  <script type="text/javascript" src="rcov.js"></script>
</head>
<body>
  <h1>Rspec Steps C0 Coverage Information - RCov</h1>
  <h2>rcov/ruby/1.8/gems/rspec-core-2.5.1/lib/rspec/core/extensions/module_eval_with_args.rb</h2>

  <div class="report_table_wrapper">
    <table class='report' id='report_table'>
      <thead>
        <tr>
          <th class="left_align">Name</th>
          <th class="right_align">Total Lines</th>
          <th class="right_align">Lines of Code</th>
          <th class="left_align">Total Coverage</th>
          <th class="left_align">Code Coverage</th>
        </tr>
      </thead>
      <tbody>
        <tr>
          <td class="left_align"><a href="rcov-ruby-1_8-gems-rspec-core-2_5_1-lib-rspec-core-extensions-module_eval_with_args_rb.html">rcov/ruby/1.8/gems/rspec-core-2.5.1/lib/rspec/core/extensions/module_eval_with_args.rb</a></td>
          <td class='right_align'><tt>34</tt></td>
          <td class='right_align'><tt>16</tt></td>
          <td class="left_align"><div class="percent_graph_legend"><tt class=''>20.59%</tt></div>
        <div class="percent_graph">
          <div class="covered" style="width:21px"></div>
          <div class="uncovered" style="width:79px"></div>
        </div></td>
          <td class="left_align"><div class="percent_graph_legend"><tt class=''>37.50%</tt></div>
        <div class="percent_graph">
          <div class="covered" style="width:38px"></div>
          <div class="uncovered" style="width:62px"></div>
        </div></td>
        </tr>
      </tbody>
    </table>
  </div>

  <h3>Key</h3>

  <div class="key"><pre><span class='marked'>Code reported as executed by Ruby looks like this...</span><span class='marked1'>and this: this line is also marked as covered.</span><span class='inferred'>Lines considered as run by rcov, but not reported by Ruby, look like this,</span><span class='inferred1'>and this: these lines were inferred by rcov (using simple heuristics).</span><span class='uncovered'>Finally, here's a line marked as not executed.</span></pre></div>

  <h3>Coverage Details</h3>

  <table class="details">
    <tbody>

        <tr class="marked">
          <td><pre><a name="line1">1</a> module RSpec</pre></td>
        </tr>

        <tr class="marked">
          <td><pre><a name="line2">2</a>   module Core</pre></td>
        </tr>

        <tr class="marked">
          <td><pre><a name="line3">3</a>     module Extensions</pre></td>
        </tr>

        <tr class="marked">
          <td><pre><a name="line4">4</a>       module ModuleEvalWithArgs</pre></td>
        </tr>

        <tr class="marked">
          <td><pre><a name="line5">5</a>         include InstanceEvalWithArgs</pre></td>
        </tr>

        <tr class="inferred">
          <td><pre><a name="line6">6</a> </pre></td>
        </tr>

        <tr class="marked">
          <td><pre><a name="line7">7</a>         def module_eval_with_args(*args, &amp;block)</pre></td>
        </tr>

        <tr class="uncovered">
          <td><pre><a name="line8">8</a>           # ruby &gt; 1.8.6</pre></td>
        </tr>

        <tr class="uncovered">
          <td><pre><a name="line9">9</a>           return module_exec(*args, &amp;block) if respond_to?(:module_exec)</pre></td>
        </tr>

        <tr class="uncovered">
          <td><pre><a name="line10">10</a> </pre></td>
        </tr>

        <tr class="uncovered">
          <td><pre><a name="line11">11</a>           # If there are no args and the block doesn't expect any, there's no</pre></td>
        </tr>

        <tr class="uncovered">
          <td><pre><a name="line12">12</a>           # need to fake module_exec with our hack below.</pre></td>
        </tr>

        <tr class="uncovered">
          <td><pre><a name="line13">13</a>           # Notes:</pre></td>
        </tr>

        <tr class="uncovered">
          <td><pre><a name="line14">14</a>           #   * lambda {      }.arity # =&gt; -1</pre></td>
        </tr>

        <tr class="uncovered">
          <td><pre><a name="line15">15</a>           #   * lambda { ||   }.arity # =&gt;  0</pre></td>
        </tr>

        <tr class="uncovered">
          <td><pre><a name="line16">16</a>           #   * lambda { |*a| }.arity # =&gt; -1</pre></td>
        </tr>

        <tr class="uncovered">
          <td><pre><a name="line17">17</a>           return module_eval(&amp;block) if block.arity &lt; 1 &amp;&amp; args.size.zero?</pre></td>
        </tr>

        <tr class="uncovered">
          <td><pre><a name="line18">18</a> </pre></td>
        </tr>

        <tr class="uncovered">
          <td><pre><a name="line19">19</a>           orig_singleton_methods = singleton_methods</pre></td>
        </tr>

        <tr class="uncovered">
          <td><pre><a name="line20">20</a>           instance_eval_with_args(*args, &amp;block)</pre></td>
        </tr>

        <tr class="uncovered">
          <td><pre><a name="line21">21</a> </pre></td>
        </tr>

        <tr class="uncovered">
          <td><pre><a name="line22">22</a>           # The only difference between instance_eval and module_eval is static method defs.</pre></td>
        </tr>

        <tr class="uncovered">
          <td><pre><a name="line23">23</a>           #   * `def foo` in instance_eval defines a singleton method on the instance</pre></td>
        </tr>

        <tr class="uncovered">
          <td><pre><a name="line24">24</a>           #   * `def foo` in class/module_eval defines an instance method for the class/module</pre></td>
        </tr>

        <tr class="uncovered">
          <td><pre><a name="line25">25</a>           # Here we deal with this difference by defining an instance method for</pre></td>
        </tr>

        <tr class="uncovered">
          <td><pre><a name="line26">26</a>           # each new singleton method.</pre></td>
        </tr>

        <tr class="uncovered">
          <td><pre><a name="line27">27</a>           # This has the side effect of duplicating methods (all new class methods will</pre></td>
        </tr>

        <tr class="uncovered">
          <td><pre><a name="line28">28</a>           # become instance methods and vice versa), but I don't see a way around it...</pre></td>
        </tr>

        <tr class="uncovered">
          <td><pre><a name="line29">29</a>           (singleton_methods - orig_singleton_methods).each { |m| define_method(m, &amp;method(m)) }</pre></td>
        </tr>

        <tr class="uncovered">
          <td><pre><a name="line30">30</a>         end</pre></td>
        </tr>

        <tr class="uncovered">
          <td><pre><a name="line31">31</a>       end</pre></td>
        </tr>

        <tr class="uncovered">
          <td><pre><a name="line32">32</a>     end</pre></td>
        </tr>

        <tr class="uncovered">
          <td><pre><a name="line33">33</a>   end</pre></td>
        </tr>

        <tr class="uncovered">
          <td><pre><a name="line34">34</a> end</pre></td>
        </tr>

    </tbody>
  </table>

  <p>Generated on Fri Apr 22 17:22:41 -0700 2011 with <a href="http://github.com/relevance/rcov">rcov 0.9.8</a></p>

</body>

</html>