Sha256: 89c2acd2fb05853770c23c1a2d5889452f1f62c73b0b410d9c5cb16d340b6ae3

Contents?: true

Size: 637 Bytes

Versions: 4

Compression:

Stored size: 637 Bytes

Contents

require File.join(File.dirname(__FILE__), %w[.. spec_helper])

require TireSwing.path(%w(spec grammars lists))

describe Lists::GrammarParser do
  describe ".ast" do
    before(:each) do
      @input = <<-EOD
[1, 2, 3]
[4, 5]
[6, 7,8,9,10]
      EOD
      @result = Lists::GrammarParser.ast(@input)
    end

    it "returns an AST" do
      @result.should be_an_instance_of(Lists::AST::Lists)
    end

    it "has an array of lists" do
      @result.should have(3).lists
    end

    it "has lists with numbers" do
      @result.lists.first.should have(3).numbers
      @result.lists.first.numbers.should == [1, 2, 3]
    end

  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
aniero-tire_swing-0.0.3 spec/integration/lists_spec.rb
aniero-tire_swing-0.0.4 spec/integration/lists_spec.rb
aniero-tire_swing-0.0.5 spec/integration/lists_spec.rb
aniero-tire_swing-0.0.6 spec/integration/lists_spec.rb