aboutsummaryrefslogtreecommitdiffstats
path: root/spec/rubyspec/library/stringscanner/shared/peek.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/rubyspec/library/stringscanner/shared/peek.rb')
-rw-r--r--spec/rubyspec/library/stringscanner/shared/peek.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/spec/rubyspec/library/stringscanner/shared/peek.rb b/spec/rubyspec/library/stringscanner/shared/peek.rb
index f414cc3b40..418ebb6536 100644
--- a/spec/rubyspec/library/stringscanner/shared/peek.rb
+++ b/spec/rubyspec/library/stringscanner/shared/peek.rb
@@ -3,12 +3,15 @@ describe :strscan_peek, shared: true do
@s = StringScanner.new('This is a test')
end
- it "returns at most the specified number of characters from the current position" do
+ it "returns at most the specified number of bytes from the current position" do
@s.send(@method, 4).should == "This"
@s.pos.should == 0
@s.pos = 5
@s.send(@method, 2).should == "is"
@s.send(@method, 1000).should == "is a test"
+
+ s = StringScanner.new("été")
+ s.send(@method, 2).should == "é"
end
it "returns an empty string when the passed argument is zero" do