summaryrefslogtreecommitdiff
path: root/spec/ruby/core/string/shared/slice.rb
diff options
context:
space:
mode:
authorBenoit Daloze <eregontp@gmail.com>2024-03-14 21:44:53 +0100
committerBenoit Daloze <eregontp@gmail.com>2024-03-14 21:44:53 +0100
commited2f68525302413a676d81821b949a21d46407e9 (patch)
treeabfde129320df80dc37e98fcbb13581e3ac6f97b /spec/ruby/core/string/shared/slice.rb
parent1d9f99144bb5239de303c51b86ccde3a33782e8d (diff)
Update to ruby/spec@89175b2
Diffstat (limited to 'spec/ruby/core/string/shared/slice.rb')
-rw-r--r--spec/ruby/core/string/shared/slice.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/spec/ruby/core/string/shared/slice.rb b/spec/ruby/core/string/shared/slice.rb
index 3ef4bc50d7..2f69b9ddce 100644
--- a/spec/ruby/core/string/shared/slice.rb
+++ b/spec/ruby/core/string/shared/slice.rb
@@ -84,8 +84,8 @@ describe :string_slice_index_length, shared: true do
s = "hello there"
s.send(@method, 1, 9).encoding.should == s.encoding
- a = "hello".force_encoding("binary")
- b = " there".force_encoding("ISO-8859-1")
+ a = "hello".dup.force_encoding("binary")
+ b = " there".dup.force_encoding("ISO-8859-1")
c = (a + b).force_encoding(Encoding::US_ASCII)
c.send(@method, 0, 5).encoding.should == Encoding::US_ASCII