rcov outside rails

1k views Asked by At

This may seem obvious but I don't find a way to run Rcov or coverMe outside a Rails project. I would like to use it with Rspec 2.5 I am using Ruby 1.9.2 so I guess this may be the problem.

I also would like not to use rake tasks but a command on the command line. I have tried several things and the best result I got is Rcov report for :

/var/lib/gems/1.9.1/gems/rcov-0.9.9/lib/rcov/code_coverage_analyzer.rb

and

/var/lib/gems/1.9.1/gems/rcov-0.9.9/lib/rcov/code_coverage_analyzer.rb

No idea why

3

There are 3 answers

0
Federico Builes On

The latest available version of rcov (0.9.8) still doesn't have good support for 1.9.2. You can try to run it on your project by doing:

 rcov spec/*.rb

But you'll most likely get something like:

 ** WARNING: Ruby 1.9 Support is experimental at best. Don't expect correct results! **

And then some errors after that.

0
Andrew Grimm On

Check out http://ruby-toolbox.com/categories/code_metrics.html for some alternatives to RCov if using Ruby 1.9 is the problem.

0
Payal On

SimpleCov, it runs awesome outside the Rails box.

http://rubydoc.info/gems/simplecov/0.5.4/frames