Skip to content

Commit b403c5b

Browse files
committed
don't use immediate value for the paths.
* `-I` with `__dir__` relative path * `ruby` command with `RbConfig.ruby`
1 parent 8d991da commit b403c5b

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

test/support/utils.rb

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,14 @@ def debug_print msg
3333
print msg if DEBUG_MODE
3434
end
3535

36+
RUBY = RbConfig.ruby
37+
3638
def create_pseudo_terminal
37-
ENV['RUBYOPT'] = '-I ./lib'
39+
lib = "#{__dir__}/../../lib"
40+
ENV['RUBYOPT'] = "-I #{lib}"
3841
ENV['RUBY_DEBUG_USE_COLORIZE'] = "false"
3942

40-
PTY.spawn("ruby -r debug/run #{temp_file_path}") do |read, write, pid|
43+
PTY.spawn("#{RUBY} -r debug/run #{temp_file_path}") do |read, write, pid|
4144
quit = false
4245
result = nil
4346

0 commit comments

Comments
 (0)