Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SimpleCov 0% coverage

I'm working on a small gem and included simplecov to spec_helper.rb two lines:

require 'simplecov'
SimpleCov.start

When I run the rspec test, the simplecov seems started correctly but the report is not:

Finished in 0.00214 seconds
8 examples, 0 failures

Coverage report generated for /home/...... 
spec to /home/megas/Work/calc/coverage. 0 / 0 LOC (0.0%) covered.

What might be a problem and how to fix it? Thanks

like image 691
megas Avatar asked Oct 02 '12 05:10

megas


People also ask

What does SimpleCov do?

SimpleCov is a code coverage analysis tool for Ruby.

What is code coverage percentage?

Code Coverage Percentage = (Number of lines of code executed by a testing algorithm/Total number of lines of code in a system component) * 100.


1 Answers

Also make sure to enable simplecov (a.k.a. SimpleCov.start) at the very beginning of your file; especially before you require your code.

like image 67
severin Avatar answered Nov 03 '22 02:11

severin