Sha256: d310a7baeecc936b81572b3021ce09d9e94d48a5992caf110d5b24cb544de55e

Contents?: true

Size: 512 Bytes

Versions: 2

Compression:

Stored size: 512 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.4.1 spec/antelope/ace/scanner_spec.rb
antelope-0.4.0 spec/antelope/ace/scanner_spec.rb