diff options
| -rw-r--r-- | test/irb/test_raise_no_backtrace_exception.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/test/irb/test_raise_no_backtrace_exception.rb b/test/irb/test_raise_no_backtrace_exception.rb index 633646e680..3031f000ed 100644 --- a/test/irb/test_raise_no_backtrace_exception.rb +++ b/test/irb/test_raise_no_backtrace_exception.rb @@ -29,7 +29,7 @@ IRB ENV["HOME"] = tmpdir bundle_exec = ENV.key?('BUNDLE_GEMFILE') ? ['-rbundler/setup'] : [] - File.open('euc.rb', 'w') do |f| + File.open("#{tmpdir}/euc.rb", 'w') do |f| f.write(<<~EOF) # encoding: euc-jp @@ -40,7 +40,9 @@ IRB end env = {} %w(LC_MESSAGES LC_ALL LC_CTYPE LANG).each {|n| env[n] = "ja_JP.UTF-8" } - assert_in_out_err([env] + bundle_exec + %w[-rirb -W0 -e IRB.start(__FILE__) -- -f --], <<~IRB, /`raise_euc_with_invalid_byte_sequence': あ\\xFF \(RuntimeError\)/, [], encoding: "UTF-8") + args = [env] + bundle_exec + %W[-rirb -C #{tmpdir} -W0 -e IRB.start(__FILE__) -- -f --] + error = /`raise_euc_with_invalid_byte_sequence': あ\\xFF \(RuntimeError\)/ + assert_in_out_err(args, <<~IRB, error, [], encoding: "UTF-8") require_relative 'euc' raise_euc_with_invalid_byte_sequence IRB |
