From 95390532c29b357bd0158408f4cfe8353e2a00e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Rodr=C3=ADguez?= Date: Thu, 16 Apr 2020 21:53:04 +0200 Subject: [PATCH] Always avoid coverage on newer rubies --- test/support/simplecov.rb | 3 +++ test/support/utils.rb | 5 ++++- test/test_helper.rb | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 test/support/simplecov.rb diff --git a/test/support/simplecov.rb b/test/support/simplecov.rb new file mode 100644 index 000000000..169f5c8b2 --- /dev/null +++ b/test/support/simplecov.rb @@ -0,0 +1,3 @@ +# frozen_string_literal: true + +require "simplecov" if ENV["NOCOV"].nil? && Gem::Version.new(RUBY_VERSION) < Gem::Version.new("2.6.a") diff --git a/test/support/utils.rb b/test/support/utils.rb index f8b518c22..a8e74f348 100644 --- a/test/support/utils.rb +++ b/test/support/utils.rb @@ -260,7 +260,10 @@ def shell_out_env(simplecov: true) "RUBYOPT" => "-I #{lib_dir}" } - base["RUBYOPT"] += " -r simplecov" if simplecov + if simplecov + test_dir = File.expand_path("..", __dir__) + base["RUBYOPT"] += " -r #{test_dir}/support/simplecov.rb" + end base end diff --git a/test/test_helper.rb b/test/test_helper.rb index eb068f66d..be32cef81 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require "simplecov" if ENV["NOCOV"].nil? && Gem::Version.new(RUBY_VERSION) < Gem::Version.new("2.6.a") +require "support/simplecov" require "support/test_case" Byebug::TestCase.before_suite