diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2022-12-02 12:08:25 +0900 |
---|---|---|
committer | git <svn-admin@ruby-lang.org> | 2022-12-02 03:14:51 +0000 |
commit | b6c66ead9da8e4a8a0aeed0eece056d74273b6d9 (patch) | |
tree | 868db2787425cde6ee83f3e947cfaf1b4b4c57e5 /test | |
parent | d55d1a737bf5784856cd35f2d94b7b5d411e6d3c (diff) |
[ruby/irb] Use the proper ruby command and library path
https://github.com/ruby/irb/commit/1416cc1871
Diffstat (limited to 'test')
-rw-r--r-- | test/irb/test_debug_cmd.rb | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/test/irb/test_debug_cmd.rb b/test/irb/test_debug_cmd.rb index 50ce904657..69e1e97015 100644 --- a/test/irb/test_debug_cmd.rb +++ b/test/irb/test_debug_cmd.rb @@ -3,10 +3,13 @@ require "pty" unless RUBY_ENGINE == 'truffleruby' require "tempfile" require "tmpdir" +require "envutil" require_relative "helper" module TestIRB + LIB = File.expand_path("../../lib", __dir__) + class DebugCommandTestCase < TestCase IRB_AND_DEBUGGER_OPTIONS = { "RUBY_DEBUG_NO_RELINE" => "true", "NO_COLOR" => "true", "RUBY_DEBUG_HISTORY_FILE" => '' @@ -196,7 +199,7 @@ module TestIRB private def run_ruby_file(&block) - cmd = "ruby -Ilib #{@ruby_file.to_path}" + cmd = [EnvUtil.rubybin, "-I", LIB, @ruby_file.to_path] tmp_dir = Dir.mktmpdir rc_file = File.open(File.join(tmp_dir, ".irbrc"), "w+") rc_file.write("IRB.conf[:USE_SINGLELINE] = true") @@ -207,7 +210,7 @@ module TestIRB yield - PTY.spawn(IRB_AND_DEBUGGER_OPTIONS.merge("IRBRC" => rc_file.to_path), cmd) do |read, write, pid| + PTY.spawn(IRB_AND_DEBUGGER_OPTIONS.merge("IRBRC" => rc_file.to_path), *cmd) do |read, write, pid| Timeout.timeout(3) do while line = safe_gets(read) lines << line |