1 require File.dirname(__FILE__) + '/../../spec_helper'
4 describe "StringScanner#skip_until" do
6 @s = StringScanner.new("This is a test")
9 it "returns the number of bytes advanced and advances the scan pointer until pattern is matched and consumed" do
10 @s.skip_until(/a/).should == 9
12 @s.matched.should == "a"
15 it "returns nil if no match was found" do
16 @s.skip_until(/d+/).should == nil