diff options
Diffstat (limited to 'spec/ruby/core/string/each_byte_spec.rb')
-rw-r--r-- | spec/ruby/core/string/each_byte_spec.rb | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/spec/ruby/core/string/each_byte_spec.rb b/spec/ruby/core/string/each_byte_spec.rb index e04dca807f..7b3db265ac 100644 --- a/spec/ruby/core/string/each_byte_spec.rb +++ b/spec/ruby/core/string/each_byte_spec.rb @@ -9,26 +9,26 @@ describe "String#each_byte" do end it "keeps iterating from the old position (to new string end) when self changes" do - r = "" - s = "hello world" + r = +"" + s = +"hello world" s.each_byte do |c| r << c s.insert(0, "<>") if r.size < 3 end r.should == "h><>hello world" - r = "" - s = "hello world" + r = +"" + s = +"hello world" s.each_byte { |c| s.slice!(-1); r << c } r.should == "hello " - r = "" - s = "hello world" + r = +"" + s = +"hello world" s.each_byte { |c| s.slice!(0); r << c } r.should == "hlowrd" - r = "" - s = "hello world" + r = +"" + s = +"hello world" s.each_byte { |c| s.slice!(0..-1); r << c } r.should == "h" end |