diff options
Diffstat (limited to 'spec/ruby/core/string/shared/each_codepoint_without_block.rb')
-rw-r--r-- | spec/ruby/core/string/shared/each_codepoint_without_block.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/spec/ruby/core/string/shared/each_codepoint_without_block.rb b/spec/ruby/core/string/shared/each_codepoint_without_block.rb index 92b7f76032..31b4c02c9c 100644 --- a/spec/ruby/core/string/shared/each_codepoint_without_block.rb +++ b/spec/ruby/core/string/shared/each_codepoint_without_block.rb @@ -6,7 +6,7 @@ describe :string_each_codepoint_without_block, shared: true do end it "returns an Enumerator even when self has an invalid encoding" do - s = "\xDF".force_encoding(Encoding::UTF_8) + s = "\xDF".dup.force_encoding(Encoding::UTF_8) s.valid_encoding?.should be_false s.send(@method).should be_an_instance_of(Enumerator) end @@ -23,7 +23,7 @@ describe :string_each_codepoint_without_block, shared: true do end it "should return the size of the string even when the string has an invalid encoding" do - s = "\xDF".force_encoding(Encoding::UTF_8) + s = "\xDF".dup.force_encoding(Encoding::UTF_8) s.valid_encoding?.should be_false s.send(@method).size.should == 1 end |