summaryrefslogtreecommitdiff
path: root/spec/ruby/core/string/byteindex_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/core/string/byteindex_spec.rb')
-rw-r--r--spec/ruby/core/string/byteindex_spec.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/spec/ruby/core/string/byteindex_spec.rb b/spec/ruby/core/string/byteindex_spec.rb
index 7be0c7ec1e..47c7be1029 100644
--- a/spec/ruby/core/string/byteindex_spec.rb
+++ b/spec/ruby/core/string/byteindex_spec.rb
@@ -156,11 +156,11 @@ describe "String#byteindex with String" do
end
it "handles a substring in a superset encoding" do
- 'abc'.force_encoding(Encoding::US_ASCII).byteindex('é').should == nil
+ 'abc'.dup.force_encoding(Encoding::US_ASCII).byteindex('é').should == nil
end
it "handles a substring in a subset encoding" do
- 'été'.byteindex('t'.force_encoding(Encoding::US_ASCII)).should == 2
+ 'été'.byteindex('t'.dup.force_encoding(Encoding::US_ASCII)).should == 2
end
end
end