Skip to content
This repository was archived by the owner on Nov 30, 2024. It is now read-only.

Commit 7120f69

Browse files
committed
Enforce 100% coverage based on ENV, rather than script constant
1 parent 4063be9 commit 7120f69

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

.github/workflows/ci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ env:
2020
RSPEC_CI: true
2121
# This tells rspec-rails what branch to run in ci
2222
RSPEC_VERSION: '= 3.14.0.pre'
23-
COVERAGE_ONLY_ON: "3.3"
23+
ENFORCE_COVERAGE_AFTER: "3.1"
2424
jobs:
2525
rubocop:
2626
name: Rubocop

script/rspec_with_simplecov

+2-5
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,15 @@ begin
2424
# Simplecov emits some ruby warnings when loaded, so silence them.
2525
old_verbose, $VERBOSE = $VERBOSE, false
2626

27-
skip_because_no_coverage = ENV['NO_COVERAGE']
28-
skip_because_wrong_version = ENV['COVERAGE_ONLY_ON'] && ENV['COVERAGE_ONLY_ON'].to_f != RUBY_VERSION.to_f
29-
30-
unless skip_because_no_coverage || skip_because_wrong_version
27+
unless ENV['NO_COVERAGE'] || RUBY_VERSION.to_f < 2.1
3128
require 'simplecov'
3229

3330
SimpleCov.start do
3431
root File.expand_path("../..", __FILE__)
3532
add_filter %r{/bundle/}
3633
add_filter %r{/tmp/}
3734
add_filter %r{/spec/}
38-
minimum_coverage(100) if RUBY_VERSION.to_f >= 3.1
35+
minimum_coverage(100) if RUBY_VERSION.to_f >= ENV['ENFORCE_COVERAGE_AFTER'].to_f
3936
end
4037
end
4138
rescue LoadError # rubocop:disable Lint/SuppressedException

0 commit comments

Comments
 (0)