title: RCov for RSpec 2 not detecting coverage correctly? (not Rails!)
body: <p><strong>Preface</strong><br>
  I've just started getting into Ruby and try to not only learn the language but also some development strategies. As kind of a beginner I'm concentrating on Test and Behaviour Driven Development. (yes, I'm doing both for comparison purposes)</p>
  
  <p>With my small software project I'm using  </p>
  
  <ul>
  <li>UnitTest (TDD)</li>
  <li>Cucumber (BDD)</li>
  <li>Rspec (TDD and BDD)</li>
  </ul>
  
  <p>On various places I encountered RCov as a tool for telling me how much of my actual code I'm really testing.</p>
  
  <p>I set up the following RakeTask in my <code>Rakefile</code> for the covarage analysis of the UnitTests:</p>
  
  <pre><code>desc "Run RCov to get coverage of UnitTests"
  Rcov::RcovTask.new(:rcov_units) do |t|
    t.pattern = 'tests/**/tc_*.rb'
    t.verbose = true
    t.rcov_opts &lt;&lt; "--html"
    t.rcov_opts &lt;&lt; "--text-summary"
    t.output_dir = "coverage/tests"
  end
  </code></pre>
  
  <p>This works fine and I'm getting a nice coloured HTML report in <code>coverage/tests</code>.</p>
  
  <p><strong>Problem Introduction</strong><br>
  Similar I wrote the following RakeTasks for RCov to be used for coverage analysis of my specs:</p>
  
  <pre><code>desc "Run RCov to get coverage of Specs"
  Rcov::RcovTask.new(:rcov_spec) do |t|
    t.pattern = 'spec/**/*_spec.rb'
    t.verbose = true
    t.rcov_opts &lt;&lt; "--html"
    t.rcov_opts &lt;&lt; "--text-summary"
    t.output_dir = "coverage/spec"
  end
  </code></pre>
  
  <p><strong>Problem Definition</strong><br>
  However, the generated HTML report in <code>coverage/spec</code> looks somehow incomplete and almost failed.</p>
  
  <p>None of the tested method bodies are marked as covered and thus red. However, I'm 100% sure they are executed within the specs. Only the lines <code>def method_name(args)</code> and <code>class ClassName</code> are marked 'green'. (as well lines with <code>attr_reader :instance_variable</code>)</p>
  
  <p>Am I missing something?</p>
  
  <hr>
  
  <pre><code>$: ruby --version  
  ruby 1.8.7 (2011-02-18 patchlevel 334) [x86_64-linux]
  
  $: rspec --version  
  2.8.0
  
  $: rcov --version  
  rcov 0.9.11 2010-02-28
  
  $: rake --version  
  rake, version 0.9.2
  </code></pre>