1 require File.dirname(__FILE__) + '/../../spec_helper'
4 describe "StringScanner#peek" do
5 it "returns at most the specified number of characters from the current position" do
6 s = StringScanner.new "peek spec"
8 s.peek(2).should == "sp"
9 s.peek(1000).should == "spec"