Sha256: 71e5d84547085f12804203a06d870ec8211875f4c0eb32310e5df696c61e0cd9

Contents?: true

Size: 275 Bytes

Versions: 3

Compression:

Stored size: 275 Bytes

Contents

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

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rubysl-strscan-1.0.1 spec/reset_spec.rb
rubysl-strscan-1.0.0 spec/reset_spec.rb
rubysl-strscan-2.0.0 spec/reset_spec.rb