Find Test Coverage Locally.

Hi All,

the gem called ‘simple_cov’ made this possible. To find the test coverage locally.

setup your test enviroment for this


update the gemfile

add gem ‘simplecov’ to the group test in gemfile.


update the spec_helper or rails_helper

add below line to the top of the helper file

require ‘simplecov’

also update the below following:

SimpleCov.start do
add_group ‘Controllers’, ‘app/controllers’
add_group ‘Models’, ‘app/models’

group is simply show us how to group the controllers to a different path.


done all set

to show the output ; need to run the rspec .

rspec spec/

the result is in index.html under the coverage folder in rails_root path.




thanks  🙂



One Comment Add yours

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s