<!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-mocks-2.5.0/lib/rspec/mocks/extensions/instance_exec.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-mocks-2.5.0/lib/rspec/mocks/extensions/instance_exec.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-mocks-2_5_0-lib-rspec-mocks-extensions-instance_exec_rb.html">rcov/ruby/1.8/gems/rspec-mocks-2.5.0/lib/rspec/mocks/extensions/instance_exec.rb</a></td> <td class='right_align'><tt>31</tt></td> <td class='right_align'><tt>24</tt></td> <td class="left_align"><div class="percent_graph_legend"><tt class=''>12.90%</tt></div> <div class="percent_graph"> <div class="covered" style="width:13px"></div> <div class="uncovered" style="width:87px"></div> </div></td> <td class="left_align"><div class="percent_graph_legend"><tt class=''>16.67%</tt></div> <div class="percent_graph"> <div class="covered" style="width:17px"></div> <div class="uncovered" style="width:83px"></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 Mocks</pre></td> </tr> <tr class="marked"> <td><pre><a name="line3">3</a> module InstanceExec</pre></td> </tr> <tr class="marked"> <td><pre><a name="line4">4</a> unless respond_to?(:instance_exec)</pre></td> </tr> <tr class="uncovered"> <td><pre><a name="line5">5</a> # based on Bounded Spec InstanceExec (Mauricio Fernandez)</pre></td> </tr> <tr class="uncovered"> <td><pre><a name="line6">6</a> # http://eigenclass.org/hiki/bounded+space+instance_exec</pre></td> </tr> <tr class="uncovered"> <td><pre><a name="line7">7</a> # - uses singleton_class of matcher instead of global</pre></td> </tr> <tr class="uncovered"> <td><pre><a name="line8">8</a> # InstanceExecHelper module</pre></td> </tr> <tr class="uncovered"> <td><pre><a name="line9">9</a> # - this keeps it scoped to this class only, which is the</pre></td> </tr> <tr class="uncovered"> <td><pre><a name="line10">10</a> # only place we need it</pre></td> </tr> <tr class="uncovered"> <td><pre><a name="line11">11</a> # - only necessary for ruby 1.8.6</pre></td> </tr> <tr class="uncovered"> <td><pre><a name="line12">12</a> def instance_exec(*args, &block)</pre></td> </tr> <tr class="uncovered"> <td><pre><a name="line13">13</a> singleton_class = (class << self; self; end)</pre></td> </tr> <tr class="uncovered"> <td><pre><a name="line14">14</a> begin</pre></td> </tr> <tr class="uncovered"> <td><pre><a name="line15">15</a> orig_critical, Thread.critical = Thread.critical, true</pre></td> </tr> <tr class="uncovered"> <td><pre><a name="line16">16</a> n = 0</pre></td> </tr> <tr class="uncovered"> <td><pre><a name="line17">17</a> n += 1 while respond_to?(method_name="__instance_exec#{n}")</pre></td> </tr> <tr class="uncovered"> <td><pre><a name="line18">18</a> singleton_class.module_eval{ define_method(method_name, &block) }</pre></td> </tr> <tr class="uncovered"> <td><pre><a name="line19">19</a> ensure</pre></td> </tr> <tr class="uncovered"> <td><pre><a name="line20">20</a> Thread.critical = orig_critical</pre></td> </tr> <tr class="uncovered"> <td><pre><a name="line21">21</a> end</pre></td> </tr> <tr class="uncovered"> <td><pre><a name="line22">22</a> begin</pre></td> </tr> <tr class="uncovered"> <td><pre><a name="line23">23</a> return send(method_name, *args)</pre></td> </tr> <tr class="uncovered"> <td><pre><a name="line24">24</a> ensure</pre></td> </tr> <tr class="uncovered"> <td><pre><a name="line25">25</a> singleton_class.module_eval{ remove_method(method_name) } rescue nil</pre></td> </tr> <tr class="uncovered"> <td><pre><a name="line26">26</a> end</pre></td> </tr> <tr class="uncovered"> <td><pre><a name="line27">27</a> end</pre></td> </tr> <tr class="uncovered"> <td><pre><a name="line28">28</a> end</pre></td> </tr> <tr class="uncovered"> <td><pre><a name="line29">29</a> end</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> </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>