Change soft-fail to use the config, rather than env
[rbx.git] / spec / frozen / 1.8 / library / stringscanner / match_spec.rb
bloba5a609baed64624e0d31a6da04af20759daaae14
1 require File.dirname(__FILE__) + '/../../spec_helper'
2 require 'strscan'
4 describe "StringScanner#match?" do
5   before :each do
6     @s = StringScanner.new("This is a test")
7   end
9   it "returns the length of the match and the scan pointer is not advanced" do
10     @s.match?(/\w+/).should == 4
11     @s.match?(/\w+/).should == 4
12     @s.pos.should == 0
13   end
15   it "returns nil if there's no match" do
16     @s.match?(/\d+/).should == nil
17     @s.match?(/\s+/).should == nil
18   end
19 end