Skip to content

Commit

Permalink
Merge pull request #240 from nobu/fix-test
Browse files Browse the repository at this point in the history
Fix test/irb/test_raise_no_backtrace_exception.rb
  • Loading branch information
nobu authored May 19, 2021
2 parents 25bb4c8 + d2eede2 commit 2eb7d9c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions test/irb/test_raise_no_backtrace_exception.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def test_raise_exception_with_different_encoding_containing_invalid_byte_sequenc
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
Expand All @@ -38,7 +38,11 @@ def raise_euc_with_invalid_byte_sequence
end
EOF
end
assert_in_out_err(bundle_exec + %w[-rirb -W0 -e ENV[%(LC_ALL)]=%(ja_JP.UTF-8) -e ENV[%(LANG)]=%(ja_JP.UTF-8) -e IRB.start(__FILE__) -- -f --], <<~IRB, /`raise_euc_with_invalid_byte_sequence': あ\\xFF \(RuntimeError\)/, [], encoding: "UTF-8")
env = {}
%w(LC_MESSAGES LC_ALL LC_CTYPE LANG).each {|n| env[n] = "ja_JP.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
Expand Down

0 comments on commit 2eb7d9c

Please sign in to comment.