From 4a8acf46258e1b6fb57e75e4461f9e4895064bda Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Thu, 30 Apr 2020 22:54:42 +0900 Subject: [PATCH] [ruby/irb] Restore the default encodings IRB::ReadlineInputMethod#initialize sets via IRB.set_encoding. --- test/irb/test_cmd.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/irb/test_cmd.rb b/test/irb/test_cmd.rb index daf6375f14..e50d036f19 100644 --- a/test/irb/test_cmd.rb +++ b/test/irb/test_cmd.rb @@ -17,12 +17,16 @@ module TestIRB Dir.chdir(@tmpdir) @home_backup = ENV["HOME"] ENV["HOME"] = @tmpdir + @default_encoding = [Encoding.default_external, Encoding.default_internal] end def teardown ENV["HOME"] = @home_backup Dir.chdir(@pwd) FileUtils.rm_rf(@tmpdir) + EnvUtil.suppress_warning { + Encoding.default_external, Encoding.default_internal = *@default_encoding + } end def test_irb_info_multiline