Skip to content

Getting rcov to work and usage

shuoman edited this page Nov 27, 2010 · 1 revision

1. Add “gem ‘rcov’” to the gemfile.

2. Add the following to the rakefile:
desc “Run all specs with rcov”
RSpec::Core::RakeTask.new(“test_cov”) do |t|
t.rcov = true
t.rcov_opts = %w{—rails —include views -Ispec —exclude gems\/,spec\/,features\/,seeds\/}
end

3. Run the test coverage with: rake test_cov

4. Open the index.html file from /coverage and check out the code coverage. You’ll be able to see what has not been tested yet.