# Rcov limitation

**URL:** <https://www.ruby-forum.com/t/rcov-limitation/133714>\
**Category:** Ruby\
**Created:** [April 2, 2008, 10:51pm UTC](https://www.ruby-forum.com/t/rcov-limitation/133714 "2008-04-02T22:51:06Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![zakifataya](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/c89c15/32.png) [@zakifataya](https://www.ruby-forum.com/u/zakifataya)\
**Post date:** [April 2, 2008, 10:51pm UTC](https://www.ruby-forum.com/t/rcov-limitation/133714/1 "2008-04-02T22:51:06Z")

</div>

When using rcov to measure the code coverage of the following:

2 Symbol.class\_eval do  
3 def to\_proc  
4 lambda {|obj, \*args| obj.send(self, \*args) }  
5 end  
6 end

it erroneously reports that lines 4 - 6 have not been executed when  
executing a set of test cases via:

rake rcov

However, if I use rcov to drive only the one test case that exercises  
the above code via:

rcov -I/my\_lib\_path tc\_utility.rb

it correctly show lines 4 - 6 as being executed.

Anyone know why rcov might have a problem detecting this when running  
a set of files instead of an individual?

My Rakefile includes the following for the rcov task:

lib\_dir = [File.expand\_path(’…’)]

Rcov::RcovTask.new do |t|  
t.libs = lib\_dir  
t.test\_files = FileList[‘tc\_\*.rb’]  
t.verbose = true  
end

Brian A.
