diff --git a/test/support/utils.rb b/test/support/utils.rb index 8f807599e..779afe9dc 100644 --- a/test/support/utils.rb +++ b/test/support/utils.rb @@ -239,9 +239,14 @@ def run_program(env, cmd, input = "") # def run_byebug(*args, input: "") caller_method = Thread.current.backtrace_locations[2].label - cmd = [*binstub, "-r", "simplecov", *args] + cmd = [*binstub, *args] + byebug_dir = File.absolute_path(File.join("..", "..", "lib"), __dir__) + env = { + "MINITEST_TEST" => caller_method, + "RUBYOPT" => "-r simplecov -I #{byebug_dir}" + } - run_program({ "MINITEST_TEST" => caller_method }, cmd, input) + run_program(env, cmd, input) end # @@ -251,8 +256,7 @@ def binstub cmd = "exe/byebug" return [cmd] unless Gem.win_platform? - byebug_dir = File.absolute_path(File.join("..", "..", "lib"), __dir__) - [RbConfig.ruby, "-I", byebug_dir, cmd] + [RbConfig.ruby, cmd] end end end