This gem provides an eponymous class which iterates through a given directory checking for .rb files which are not listed in the latest SimpleCov resultset.
The recommended thing is to just install it and run directly without adding it to your Gemfile.
$ gem install simplecov_checker
Of course if you to add any automation (eg. CI warnings) you may want to do the usual Gemfile dance, but that is left as an exercise to the reader.
Running via shell is a one-liner:
$ ruby -rsimplecov_checker -e 'puts SimpleCovChecker.new.missed_files'
No options are necessary when running from the root of a standard Rails app, however if you are in a different directory, or you wish to narrow down the scope of which files you are checking, there are two options to help.
You can specify source_path
(default: ./app
) to narrow down the specific directory you want to check for uncovered files.
SimpleCovChecker.new(source_path: 'app/models')
You can also override the location of the SimpleCov directory using resultset_path
(default: ./coverage
).
SimpleCovChecker.new(resultset_path: 'app/models')
To install this gem onto your local machine, run bundle exec rake install
. To release a new version, update the version number in version.rb
, and then run bundle exec rake release
, which will create a git tag for the version, push git commits and tags, and push the .gem
file to rubygems.org.
Bug reports and pull requests are welcome on GitHub at https://github.com/gtd/simplecov_checker.
The gem is available as open source under the terms of the MIT License.