Skip to content

Commit f4aaa70

Browse files
committed
Tests may not execute in the source directory
1 parent 447b50e commit f4aaa70

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

test/irb/test_workspace.rb

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -85,14 +85,13 @@ def test_toplevel_binding_local_variables
8585
pend if RUBY_ENGINE == 'truffleruby'
8686
bug17623 = '[ruby-core:102468]'
8787
bundle_exec = ENV.key?('BUNDLE_GEMFILE') ? ['-rbundler/setup'] : []
88-
if File.exist?('./exe/irb')
89-
irb_path = './exe/irb'
90-
elsif File.exist?('./libexec/irb')
91-
irb_path = './libexec/irb'
92-
else
93-
omit 'irb command not found'
94-
end
95-
assert_in_out_err(bundle_exec + ['-W0', '-e', <<~RUBY , '--', '-f', '--'], 'binding.local_variables', /\[:_\]/, [], bug17623)
88+
top_srcdir = "#{__dir__}/../.."
89+
irb_path = nil
90+
%w[exe libexec].find do |dir|
91+
irb_path = "#{top_srcdir}/#{dir}/irb"
92+
File.exist?(irb_path)
93+
end or omit 'irb command not found'
94+
assert_in_out_err(bundle_exec + ['-W0', "-C#{top_srcdir}", '-e', <<~RUBY , '--', '-f', '--'], 'binding.local_variables', /\[:_\]/, [], bug17623)
9695
version = 'xyz' # typical rubygems loading file
9796
load('#{irb_path}')
9897
RUBY

0 commit comments

Comments
 (0)