diff --git a/test/support/console_test_case.rb b/test/support/console_test_case.rb index f7e62fb4b..187506e99 100644 --- a/test/support/console_test_case.rb +++ b/test/support/console_test_case.rb @@ -225,7 +225,12 @@ def prepare_test_environment(program, test_steps, &block) @scenario = [] test_steps.call @scenario.freeze - inject_lib_to_load_path + + ENV['RUBYOPT'] = "-I #{__dir__}/../../lib" + + if ENV.key?('BUNDLE_GEMFILE') + ENV["RUBYOPT"] += " -rbundler/setup" + end block.call @@ -283,7 +288,7 @@ def run_rdbg program, options: nil, rubyopt: nil, &test_steps prepare_test_environment(program, test_steps) do test_info = TestInfo.new(dup_scenario, 'LOCAL', /\(rdbg\)/) cmd = "#{RDBG_EXECUTABLE} #{options} -- #{temp_file_path}" - cmd = "RUBYOPT=#{rubyopt} #{cmd}" if rubyopt + ENV["RUBYOPT"] += " #{rubyopt}" if rubyopt run_test_scenario cmd, test_info end end @@ -301,10 +306,6 @@ def new_thread &block end end - def inject_lib_to_load_path - ENV['RUBYOPT'] = "-I #{__dir__}/../../lib" - end - def assert_empty_queue test_info, exception: nil message = "Expected all commands/assertions to be executed. Still have #{test_info.queue.length} left." if exception