Find Test Coverage Locally. :D

on

Hi All,

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

https://github.com/colszowka/simplecov

steps:

update the gemfile

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

1

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’
end

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

2.1.png

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.

2

 

4.png

thanks  🙂

 

Advertisements

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s