[前][次][番号順一覧][スレッド一覧]

ruby-changes:67678

From: Nobuyoshi <ko1@a...>
Date: Fri, 10 Sep 2021 08:35:08 +0900 (JST)
Subject: [ruby-changes:67678] 7983fb9658 (master): [ruby/irb] Tests may not execute in the source directory

https://git.ruby-lang.org/ruby.git/commit/?id=7983fb9658

From 7983fb965891330f5c41919b266ada53ab822f12 Mon Sep 17 00:00:00 2001
From: Nobuyoshi Nakada <nobu@r...>
Date: Fri, 10 Sep 2021 08:07:08 +0900
Subject: [ruby/irb] Tests may not execute in the source directory

https://github.com/ruby/irb/commit/f4aaa70cfc
---
 test/irb/test_workspace.rb | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)

diff --git a/test/irb/test_workspace.rb b/test/irb/test_workspace.rb
index 7439796..1a1dc1f 100644
--- a/test/irb/test_workspace.rb
+++ b/test/irb/test_workspace.rb
@@ -85,14 +85,13 @@ module TestIRB https://github.com/ruby/ruby/blob/trunk/test/irb/test_workspace.rb#L85
       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
-- 
cgit v1.1


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]