Creates an after suite hook in RSpec that dynamically creates and injects a new test case that expects the actual code coverage to be at least the lower limit set in Simplecov.
Add this line to your application's Gemfile:
And then execute:
Or install it yourself as:
$ gem install rspec-simplecov
If you are already using Rspec and SimpleCov you probably have this somewhere
near the top of your
require 'simplecov' SimpleCov.minimum_coverage 95 SimpleCov.start RSpec.configure do |config| # ...
All you need to do is require and add the initializer line for RSpec::SimpleCov like this:
require 'simplecov' require 'rspec/simplecov' SimpleCov.minimum_coverage 95 SimpleCov.start RSpec::SimpleCov.start RSpec.configure do |config| # ...
And you to can enjoy the glory of a failing RSpec suite when your code coverage
- Fork it ( https://github.com/[my-github-username]/rspec-simplecov/fork )
- Create your feature branch (
git checkout -b my-new-feature)
- Commit your changes (
git commit -am 'Add some feature')
- Push to the branch (
git push origin my-new-feature)
- Create a new Pull Request