Sha256: ebb5b83f58a4eb71e33133b719d3a8ce07746f17decf5c080e2ec76740d4697b

Contents?: true

Size: 515 Bytes

Versions: 3

Compression:

Stored size: 515 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", 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

3 entries across 3 versions & 1 rubygems

Version Path
antelope-0.2.0 spec/antelope/ace/scanner_spec.rb
antelope-0.1.11 spec/antelope/ace/scanner_spec.rb
antelope-0.1.10 spec/antelope/ace/scanner_spec.rb