Sha256: 45ca39db5c1b275eb6bb9d62dfaa7c303d1b12242cff9e1abbb98a5e5af5ac14

Contents?: true

Size: 635 Bytes

Versions: 1

Compression:

Stored size: 635 Bytes

Contents

MINIMUM_COVERAGE = 97

unless ENV['COVERAGE'] == 'off'
  require 'simplecov'
  require 'simplecov-rcov'
  require 'coveralls'
  Coveralls.wear!

  SimpleCov.formatters = [
    SimpleCov::Formatter::RcovFormatter,
    Coveralls::SimpleCov::Formatter
  ]
  SimpleCov.start do
    add_filter '/vendor/'
    add_filter '/spec/'
    add_group 'lib', 'lib'
  end
  SimpleCov.at_exit do
    SimpleCov.result.format!
    percent = SimpleCov.result.covered_percent
    puts "Coverage is #{"%.2f" % percent}%"
    unless percent >= MINIMUM_COVERAGE
      puts "Coverage must be above #{MINIMUM_COVERAGE}%"
      Kernel.exit(1)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
active_setting-0.1.0 spec/support/coverage_loader.rb