spec/spec_helper.rb in rom-sql-1.2.2 vs spec/spec_helper.rb in rom-sql-1.3.0
- old
+ new
@@ -1,11 +1,17 @@
require 'bundler'
Bundler.setup
-if RUBY_ENGINE == 'ruby' && ENV['CI'] == 'true'
- require 'simplecov'
- SimpleCov.start do
- add_filter '/spec/'
+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
end
end
require 'rom-sql'
require 'rom/sql/rake_task'