diff --git a/lib/ci/reporter/rake/test_unit.rb b/lib/ci/reporter/rake/test_unit.rb index d7ece1e..4a478eb 100644 --- a/lib/ci/reporter/rake/test_unit.rb +++ b/lib/ci/reporter/rake/test_unit.rb @@ -5,7 +5,11 @@ task :testunit do rm_rf ENV["CI_REPORTS"] || "test/reports" test_loader = CI::Reporter.maybe_quote_filename "#{File.dirname(__FILE__)}/test_unit_loader.rb" - ENV["TESTOPTS"] = "#{ENV["TESTOPTS"]} #{test_loader}" + # Use RUBYOPT instead of TESTOPTS to avoid conflicts with rake 13.4+ + # which now preserves TESTOPTS and appends -v when verbose is enabled. + # Adding a file path to TESTOPTS caused rake_test_loader to treat the + # loader file as a test file, resulting in "version unknown" errors. + ENV["RUBYOPT"] = "#{ENV["RUBYOPT"]} -r#{test_loader}" end end end