summaryrefslogtreecommitdiff
path: root/spec/ruby/core/string/unpack/b_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/core/string/unpack/b_spec.rb')
-rw-r--r--spec/ruby/core/string/unpack/b_spec.rb4
1 files changed, 2 insertions, 2 deletions
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