Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid simplecov on new rubies #671

Merged
merged 3 commits into from Apr 16, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions 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")
9 changes: 6 additions & 3 deletions test/support/utils.rb
Expand Up @@ -253,14 +253,17 @@ def shell_out_env(simplecov: true)
location.label.start_with?("test_")
end

byebug_dir = File.absolute_path(File.join("..", "..", "lib"), __dir__)
lib_dir = File.expand_path("../../lib", __dir__)

base = {
"MINITEST_TEST" => "#{self.class}##{minitest_test.label}",
"RUBYOPT" => "-I #{byebug_dir}"
"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
Expand Down
2 changes: 1 addition & 1 deletion 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