0.01
No commit activity in last 3 years
No release in over 3 years
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.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.7
~> 10.0
 Project Readme

RSpec::SimpleCov

Gem Version Code Climate GitHub issues

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.

Installation

Add this line to your application's Gemfile:

gem 'rspec-simplecov'

And then execute:

$ bundle

Or install it yourself as:

$ gem install rspec-simplecov

Usage

If you are already using Rspec and SimpleCov you probably have this somewhere near the top of your spec_helper.rb:

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 drops below SimpleCov.minimum_coverage :)

Contributing

  1. Fork it ( https://github.com/[my-github-username]/rspec-simplecov/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request