From 840115bf46476dc2b3c175f7716b4d6000906f40 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Mon, 20 Jul 2020 13:38:37 +0900 Subject: [PATCH] Make StringIO encoding fixed Get rid of affects by default external encoding. --- spec/ruby/core/kernel/printf_spec.rb | 4 ++-- spec/ruby/library/stringio/printf_spec.rb | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/spec/ruby/core/kernel/printf_spec.rb b/spec/ruby/core/kernel/printf_spec.rb index d1743dbcde..d8f93ce429 100644 --- a/spec/ruby/core/kernel/printf_spec.rb +++ b/spec/ruby/core/kernel/printf_spec.rb @@ -41,7 +41,7 @@ describe "Kernel.printf" do context "io is specified" do it_behaves_like :kernel_sprintf, -> format, *args { - io = StringIO.new + io = StringIO.new(+"") Kernel.printf(io, format, *args) io.string } @@ -51,7 +51,7 @@ describe "Kernel.printf" do it_behaves_like :kernel_sprintf, -> format, *args { stdout = $stdout begin - $stdout = io = StringIO.new + $stdout = io = StringIO.new(+"") Kernel.printf(format, *args) io.string ensure diff --git a/spec/ruby/library/stringio/printf_spec.rb b/spec/ruby/library/stringio/printf_spec.rb index f88ca1eb20..9dd1a3b410 100644 --- a/spec/ruby/library/stringio/printf_spec.rb +++ b/spec/ruby/library/stringio/printf_spec.rb @@ -32,7 +32,7 @@ describe "StringIO#printf" do describe "formatting" do it_behaves_like :kernel_sprintf, -> format, *args { - io = StringIO.new + io = StringIO.new(+"") io.printf(format, *args) io.string }