From ed2f68525302413a676d81821b949a21d46407e9 Mon Sep 17 00:00:00 2001 From: Benoit Daloze Date: Thu, 14 Mar 2024 21:44:53 +0100 Subject: Update to ruby/spec@89175b2 --- spec/ruby/core/string/unpack/a_spec.rb | 2 +- spec/ruby/core/string/unpack/b_spec.rb | 4 ++-- spec/ruby/core/string/unpack/u_spec.rb | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'spec/ruby/core/string/unpack') diff --git a/spec/ruby/core/string/unpack/a_spec.rb b/spec/ruby/core/string/unpack/a_spec.rb index 2d83b4c824..4002ece697 100644 --- a/spec/ruby/core/string/unpack/a_spec.rb +++ b/spec/ruby/core/string/unpack/a_spec.rb @@ -31,7 +31,7 @@ describe "String#unpack with format 'A'" do end it "decodes into raw (ascii) string values" do - str = "str".force_encoding('UTF-8').unpack("A*")[0] + str = "str".dup.force_encoding('UTF-8').unpack("A*")[0] str.encoding.should == Encoding::BINARY end diff --git a/spec/ruby/core/string/unpack/b_spec.rb b/spec/ruby/core/string/unpack/b_spec.rb index 5c53eff721..23d93a8aea 100644 --- a/spec/ruby/core/string/unpack/b_spec.rb +++ b/spec/ruby/core/string/unpack/b_spec.rb @@ -107,7 +107,7 @@ describe "String#unpack with format 'B'" do end it "decodes into US-ASCII string values" do - str = "s".force_encoding('UTF-8').unpack("B*")[0] + str = "s".dup.force_encoding('UTF-8').unpack("B*")[0] str.encoding.name.should == 'US-ASCII' end end @@ -215,7 +215,7 @@ describe "String#unpack with format 'b'" do end it "decodes into US-ASCII string values" do - str = "s".force_encoding('UTF-8').unpack("b*")[0] + str = "s".dup.force_encoding('UTF-8').unpack("b*")[0] str.encoding.name.should == 'US-ASCII' end end diff --git a/spec/ruby/core/string/unpack/u_spec.rb b/spec/ruby/core/string/unpack/u_spec.rb index 7845e6d5f2..456abee784 100644 --- a/spec/ruby/core/string/unpack/u_spec.rb +++ b/spec/ruby/core/string/unpack/u_spec.rb @@ -33,7 +33,7 @@ describe "String#unpack with format 'u'" do str = "".unpack("u")[0] str.encoding.should == Encoding::BINARY - str = "1".force_encoding('UTF-8').unpack("u")[0] + str = "1".dup.force_encoding('UTF-8').unpack("u")[0] str.encoding.should == Encoding::BINARY end -- cgit v1.2.3