Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ruby test coverage tool

I need a tool which measures test coverage under Ruby.

I tried rcov, but couldn't install it under Windows, Cygwin, or Ubuntu.

Which programs (not necessarily free) calculate the branch and/or line coverage of tests in Ruby and work with Ruby on Rails?

like image 237
Dmitrii Pisarenko Avatar asked Jul 10 '11 08:07

Dmitrii Pisarenko


People also ask

How do I check my RSpec coverage?

Open coverage/index. html in your browser window to view the report. Try to get the coverage to 100% by writing RSpec tests. Every time you add a test, run rspec to see if the test is passing.

What is the tool used for to check test coverage?

Qase. Qase is also a cloud computing-based project management tool, which works excellently for determining the Test Coverage periodically identified for the Test Management process.

What is SimpleCov?

SimpleCov is a code coverage analysis tool for Ruby.


2 Answers

Simplecov. Rcov doesn't work so well under Ruby 1.9.*, but simplecov does.

like image 137
Mori Avatar answered Oct 10 '22 19:10

Mori


You also have deep-cover which aims to be more complete than the mentioned examples.

From the Readme:

Deep Cover aims to be the best coverage tool for Ruby code:

more accurate line coverage

branch coverage

can be used as a drop-in replacement for the built-in Coverage library.

like image 3
Paulo Fidalgo Avatar answered Oct 10 '22 19:10

Paulo Fidalgo