|
| 1 | +From: Sorah Fukumori < [email protected]> |
| 2 | +Date: Sat, 8 Jan 2022 14:03:02 +0900 |
| 3 | +Subject: test_readline#test_without_tty: Use EnvUtil.rubybin |
| 4 | + |
| 5 | +`ruby` is not always available in certain build environments and |
| 6 | +configure options. Choose appropriate command line using EnvUtil. |
| 7 | +--- |
| 8 | + test/readline/test_readline.rb | 4 +++- |
| 9 | + 1 file changed, 3 insertions(+), 1 deletion(-) |
| 10 | + |
| 11 | +diff --git a/test/readline/test_readline.rb b/test/readline/test_readline.rb |
| 12 | +index be338c6..be6e65f 100644 |
| 13 | +--- a/test/readline/test_readline.rb |
| 14 | ++++ b/test/readline/test_readline.rb |
| 15 | +@@ -6,6 +6,8 @@ require "timeout" |
| 16 | + require "open3" |
| 17 | + |
| 18 | + module BasetestReadline |
| 19 | ++ RUBY = EnvUtil.rubybin |
| 20 | ++ |
| 21 | + INPUTRC = "INPUTRC" |
| 22 | + TERM = "TERM" |
| 23 | + SAVED_ENV = %w[COLUMNS LINES] |
| 24 | +@@ -839,7 +841,7 @@ module BasetestReadline |
| 25 | + loader = "use_lib_reline" |
| 26 | + end |
| 27 | + if loader |
| 28 | +- res, exit_status = Open3.capture2e("ruby -I#{__dir__} -Ilib -rhelper -e '#{loader}; Readline.readline(%{y or n?})'", stdin_data: "y\n") |
| 29 | ++ res, exit_status = Open3.capture2e("#{RUBY} -I#{__dir__} -Ilib -rhelper -e '#{loader}; Readline.readline(%{y or n?})'", stdin_data: "y\n") |
| 30 | + assert exit_status.success?, "It should work fine without tty, but it failed.\nError output:\n#{res}" |
| 31 | + end |
| 32 | + end |
0 commit comments