summaryrefslogtreecommitdiff
path: root/spec/ruby/library/stringscanner/fixed_anchor_spec.rb
blob: ce0b714fa8937027fef679b7e9677955320471dd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
require_relative '../../spec_helper'
require 'strscan'

describe "StringScanner#fixed_anchor?" do
  it "returns whether the fixed-anchor property is set" do
    s = StringScanner.new("foo", fixed_anchor: true)
    s.should.fixed_anchor?

    s = StringScanner.new("foo", fixed_anchor: false)
    s.should_not.fixed_anchor?
  end

  it "is set to false by default" do
    s = StringScanner.new("foo")
    s.should_not.fixed_anchor?
  end
end