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

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

  it "returns true if the scan pointer is at the end of the string" do
    @s.terminate
    @s.should.eos?

    s = StringScanner.new('')
    s.should.eos?
  end

  it "returns false if the scan pointer is not at the end of the string" do
    @s.should_not.eos?
  end
end