Skip to content

Commit

Permalink
Tests may not execute in the source directory
Browse files Browse the repository at this point in the history
  • Loading branch information
nobu committed Sep 9, 2021
1 parent 447b50e commit f4aaa70
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions test/irb/test_workspace.rb
Original file line number Diff line number Diff line change
Expand Up @@ -85,14 +85,13 @@ def test_toplevel_binding_local_variables
pend if RUBY_ENGINE == 'truffleruby'
bug17623 = '[ruby-core:102468]'
bundle_exec = ENV.key?('BUNDLE_GEMFILE') ? ['-rbundler/setup'] : []
if File.exist?('./exe/irb')
irb_path = './exe/irb'
elsif File.exist?('./libexec/irb')
irb_path = './libexec/irb'
else
omit 'irb command not found'
end
assert_in_out_err(bundle_exec + ['-W0', '-e', <<~RUBY , '--', '-f', '--'], 'binding.local_variables', /\[:_\]/, [], bug17623)
top_srcdir = "#{__dir__}/../.."
irb_path = nil
%w[exe libexec].find do |dir|
irb_path = "#{top_srcdir}/#{dir}/irb"
File.exist?(irb_path)
end or omit 'irb command not found'
assert_in_out_err(bundle_exec + ['-W0', "-C#{top_srcdir}", '-e', <<~RUBY , '--', '-f', '--'], 'binding.local_variables', /\[:_\]/, [], bug17623)
version = 'xyz' # typical rubygems loading file
load('#{irb_path}')
RUBY
Expand Down

0 comments on commit f4aaa70

Please sign in to comment.