Plugin for minitest. It provides minimal information about code coverage.
GPL-3.0 License
Minitest::Cc is a plugin for Minitest that provide a very simple and minimalism measure of code coverage by your tests.
You need to keep in mind that this information is only a reference and don't represent how effective are your tests.
Add it into your Gemfile:
# Gemfile
gem 'minitest-cc'
Then you need to require it in the very top of your test helper file:
require 'minitest/cc'
Minitest::Cc.start
If you run your tests you will see something like this:
Running 24 tests in a single process (parallelization threshold is 50)
Run options: --seed 6319
# Running:
........................
# Coverage:
lines: 95% branches: 75% methods: 93%
Finished in 1.875197s, 12.7987 runs/s, 18.6647 assertions/s.
24 runs, 35 assertions, 0 failures, 0 errors, 0 skips
Minitest::Cc.start(:lines, :branches, :methods) # this is like look by default
You can configure two aspects more:
Minitest::Cc.cc_mode = :resume
:resume
, the default behavior:per_file
to get a list of files and his coverageMinitest::Cc.tracked_files = [
'./app/**/*.rb',
'./lib/**/*.rb'
]
This configuration must be do in the helper file of your tests.
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
git checkout -b feature/AmazingFeature
)git commit -m 'Add some AmazingFeature'
)git push origin feature/AmazingFeature
)The gem is available as open source under the terms of the GPL-3.0 License.