Change soft-fail to use the config, rather than env
[rbx.git] / spec / frozen / 1.8 / library / stringscanner / skip_until_spec.rb
blob3d982ba31f77469ad7820bb4bc40f14241cfe56f
1 require File.dirname(__FILE__) + '/../../spec_helper'
2 require 'strscan'
4 describe "StringScanner#skip_until" do
5   before :each do
6     @s = StringScanner.new("This is a test")
7   end
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
11     @s.pos.should == 9
12     @s.matched.should == "a"
13   end
15   it "returns nil if no match was found" do
16     @s.skip_until(/d+/).should == nil
17   end
18 end