Sha256: 67507bc76fba893ef50a8336b1f4dcb233eee309a4434aa93308fe3449369a99

Contents?: true

Size: 539 Bytes

Versions: 2

Compression:

Stored size: 539 Bytes

Contents

describe Ace::Scanner do

  it 'properly scans' do
    expect(scan("%test \"a\" hi\n%%\nt: d { { } }\n%%\nhi\n")).to eq [
      [:directive, 'test', %w(a hi)],
      [:second],
      [:label, 't', nil],
      [:part, 'd', nil],
      [:block, '{ { } }'],
      [:third],
      [:copy, "\nhi\n"]
    ]
  end

  it 'throws an error' do
    expect {
      scan('% %% %% ')
    }.to raise_error(Ace::SyntaxError)
  end

  def scan(source)
    Timeout.timeout(5) do
      Ace::Scanner.scan(source)
    end
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
antelope-0.3.2 spec/antelope/ace/scanner_spec.rb
antelope-0.3.0 spec/antelope/ace/scanner_spec.rb