Sha256: 35b6f7e36d722e5069fea03f8f071bd875fb7ae9c1ab077b9f8b3302b234eb6d

Contents?: true

Size: 355 Bytes

Versions: 27

Compression:

Stored size: 355 Bytes

Contents

describe "StringScanner#check" do
  before :each do
    @s = StringScanner.new("This is a test")
  end

  it "returns the value that scan would return, without advancing the scan pointer" do
    @s.check(/This/).should == "This"
    @s.matched.should == "This"
    @s.pos.should == 0
    @s.check(/is/).should == nil
    @s.matched.should == nil
  end
end

Version data entries

27 entries across 27 versions & 2 rubygems

Version Path
opal-0.4.4 spec/parser/strscan/check_spec.rb
opal-0.4.3 spec/parser/strscan/check_spec.rb
opal-0.4.2 spec/parser/strscan/check_spec.rb
opal-0.4.1 spec/parser/strscan/check_spec.rb
opal-0.4.0 spec/parser/strscan/check_spec.rb
opal-0.3.44 spec/parser/strscan/check_spec.rb
opal-0.3.43 spec/parser/strscan/check_spec.rb
opal-0.3.42 spec/grammar/strscan/check_spec.rb
opal-0.3.41 spec/grammar/strscan/check_spec.rb
opal-0.3.40 spec/grammar/strscan/check_spec.rb
opal-0.3.39 spec/grammar/strscan/check_spec.rb
opal-0.3.38 spec/grammar/strscan/check_spec.rb
opal-0.3.37 spec/grammar/strscan/check_spec.rb
opal-0.3.36 spec/grammar/strscan/check_spec.rb
opal-0.3.35 spec/grammar/strscan/check_spec.rb
opal-0.3.34 spec/core/strscan/check_spec.rb
opal-0.3.33 spec/core/strscan/check_spec.rb
opal-0.3.32 spec/core/strscan/check_spec.rb
opal-0.3.31 spec/core/strscan/check_spec.rb
opal-0.3.30 spec/core/strscan/check_spec.rb