Skip to content
This repository has been archived by the owner on Jan 4, 2021. It is now read-only.

Commit

Permalink
Extract coverage and increase 2%
Browse files Browse the repository at this point in the history
  • Loading branch information
mnoack committed Sep 15, 2015
1 parent c386679 commit 84f4d9f
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 27 deletions.
28 changes: 1 addition & 27 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,33 +9,7 @@
require 'bundler/setup'

require 'support/bootstrap'

MINIMUM_COVERAGE = 63

unless ENV['COVERAGE'] == 'off'
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 #{"%.2f" % percent}%"
Kernel.exit(1)
end
end
end
require 'support/coverage'

require 'right_on'
require 'right_on/rails'
Expand Down
26 changes: 26 additions & 0 deletions spec/support/coverage.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
MINIMUM_COVERAGE = 65

unless ENV['COVERAGE'] == 'off'
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 #{"%.2f" % percent}%"
Kernel.exit(1)
end
end
end

0 comments on commit 84f4d9f

Please sign in to comment.