diff options
Diffstat (limited to 'spec/ruby/library/stringio/getch_spec.rb')
| -rw-r--r-- | spec/ruby/library/stringio/getch_spec.rb | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/spec/ruby/library/stringio/getch_spec.rb b/spec/ruby/library/stringio/getch_spec.rb index 06670a178c..113b4971bf 100644 --- a/spec/ruby/library/stringio/getch_spec.rb +++ b/spec/ruby/library/stringio/getch_spec.rb @@ -17,15 +17,13 @@ describe "StringIO#getch" do io.getch.should == ?a end - with_feature :encoding do - it "increments #pos by the byte size of the character in multibyte strings" do - io = StringIO.new("föóbar") - - io.getch; io.pos.should == 1 # "f" has byte size 1 - io.getch; io.pos.should == 3 # "ö" has byte size 2 - io.getch; io.pos.should == 5 # "ó" has byte size 2 - io.getch; io.pos.should == 6 # "b" has byte size 1 - end + it "increments #pos by the byte size of the character in multibyte strings" do + io = StringIO.new("föóbar") + + io.getch; io.pos.should == 1 # "f" has byte size 1 + io.getch; io.pos.should == 3 # "ö" has byte size 2 + io.getch; io.pos.should == 5 # "ó" has byte size 2 + io.getch; io.pos.should == 6 # "b" has byte size 1 end it "returns nil at the end of the string" do |
