This repository has been archived by the owner on Jan 4, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Extract coverage loader, on by default and use new formatters assign
- Loading branch information
Showing
2 changed files
with
27 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,5 @@ | ||
$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__) | ||
|
||
MINIMUM_COVERAGE = 93 | ||
|
||
if ENV['COVERAGE'] | ||
require 'simplecov' | ||
require 'simplecov-rcov' | ||
require 'coveralls' | ||
Coveralls.wear! | ||
|
||
SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[ | ||
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 | ||
unless percent >= MINIMUM_COVERAGE | ||
puts "Coverage must be above #{MINIMUM_COVERAGE}%. It is #{format('%.2f', percent)}%" | ||
Kernel.exit(1) | ||
end | ||
end | ||
end | ||
require 'support/coverage_loader' | ||
|
||
require 'lagomorph' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
MINIMUM_COVERAGE = 93 | ||
|
||
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 | ||
unless percent >= MINIMUM_COVERAGE | ||
puts "Coverage must be above #{MINIMUM_COVERAGE}%. It is #{format('%.2f', percent)}%" | ||
Kernel.exit(1) | ||
end | ||
end | ||
end |