diff options
Diffstat (limited to 'spec/rubyspec/library/stringscanner/reset_spec.rb')
-rw-r--r-- | spec/rubyspec/library/stringscanner/reset_spec.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/spec/rubyspec/library/stringscanner/reset_spec.rb b/spec/rubyspec/library/stringscanner/reset_spec.rb new file mode 100644 index 0000000000..9631d0bb4a --- /dev/null +++ b/spec/rubyspec/library/stringscanner/reset_spec.rb @@ -0,0 +1,15 @@ +require File.expand_path('../../../spec_helper', __FILE__) +require 'strscan' + +describe "StringScanner#reset" do + before :each do + @s = StringScanner.new("This is a test") + end + + it "reset the scan pointer and clear matching data" do + @s.scan(/This/) + @s.reset + @s.pos.should == 0 + @s.matched.should == nil + end +end |