Sha256: 93ca055b5a0932d60e1be2ce9c6657b23543d263036dcfd0d12caa614a96d0a8

Contents?: true

Size: 505 Bytes

Versions: 11

Compression:

Stored size: 505 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", ["a", "hi"]],
      [:second],
      [:label, "t"],
      [:part, "d"],
      [: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

11 entries across 11 versions & 1 rubygems

Version Path
antelope-0.1.9 spec/antelope/ace/scanner_spec.rb
antelope-0.1.8 spec/antelope/ace/scanner_spec.rb
antelope-0.1.7 spec/antelope/ace/scanner_spec.rb
antelope-0.1.6 spec/antelope/ace/scanner_spec.rb
antelope-0.1.5 spec/antelope/ace/scanner_spec.rb
antelope-0.1.4 spec/antelope/ace/scanner_spec.rb
antelope-0.1.3 spec/antelope/ace/scanner_spec.rb
antelope-0.1.2 spec/antelope/ace/scanner_spec.rb
antelope-0.1.1 spec/antelope/ace/scanner_spec.rb
antelope-0.1.0 spec/antelope/ace/scanner_spec.rb
antelope-0.0.1 spec/antelope/ace/scanner_spec.rb