[rspec-users] Rake features:rcov question
matt at mattwynne.net
Mon Jan 19 15:38:16 EST 2009
On 19 Jan 2009, at 15:49, James Byrne wrote:
> I have reached a point where I thought that it might be useful to see
> how must test coverage I have for the code I have written. However,
> running rake features:rcov produces some unexpected output. I see
> in the index file:
> /usr/lib/ruby/1.8/base64.rb ...
> /usr/lib/ruby/1.8/benchmark.rb ...
> Then my files are reported
> and so forth. Now, I have checked the spec and test directory trees
> and there does not seem to be anything in there that I recognize as
> having anything to do with the ruby libraries. My questions are: 1.
> this normal behaviour for rcov? 2. If not, then what might I have done
> to cause this?
> Posted via http://www.ruby-forum.com/.
> rspec-users mailing list
> rspec-users at rubyforge.org
Take a look at the --exclude option for rcov - that's what you need to
do. Otherwise by default it will tell you about coverage for every
ruby file that was touched during the test run, including things that
the testing framework called, and the things they called, etc.
I would have assumed this was in the default rake task that was
generated, but anyway you should be able to figure it out if you look
at rcov's options.
Running rcov yourself really isn't such a black art - from the command
line you can get coverage from a single feature using this:
rcov --exclude 'gems/*.rb' /usr/local/bin/cucumber -- path/to/
More information about the rspec-users