Skip to content

Commit

Permalink
Simplify coverage setup
Browse files Browse the repository at this point in the history
  • Loading branch information
flash-gordon committed Nov 6, 2019
1 parent 81aca89 commit 0680ab0
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
# frozen_string_literal: true

if RUBY_ENGINE == 'ruby' && ENV['COVERAGE'] == 'true'
require 'yaml'
rubies = YAML.load(File.read(File.join(__dir__, '..', '.travis.yml')))['rvm']
latest_mri = rubies.select { |v| v =~ /\A\d+\.\d+.\d+\z/ }.max

if RUBY_VERSION == latest_mri
require 'simplecov'
SimpleCov.start do
add_filter '/spec/'
end
if ENV['COVERAGE'] == 'true'
require 'simplecov'
SimpleCov.start do
add_filter '/spec/'
end
end

Expand Down

0 comments on commit 0680ab0

Please sign in to comment.