Sha256: f5156fd083e8cd6889cb9bc73dcf673db5d6b9b8a934183022f7949d0038aeab

Contents?: true

Size: 542 Bytes

Versions: 3

Compression:

Stored size: 542 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.4 spec/antelope/ace/scanner_spec.rb
antelope-0.2.3 spec/antelope/ace/scanner_spec.rb
antelope-0.2.2 spec/antelope/ace/scanner_spec.rb