rubyrubygemscode-coverage

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


Solution

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