Sha256: 5f6ede75106218e790248b345aa07d2aca122a7696b6f609556604cd0dce70c0

Contents?: true

Size: 657 Bytes

Versions: 1

Compression:

Stored size: 657 Bytes

Contents

require 'spec_helper'
module Gisele::Language::Syntax
  describe UnitDef, 'to_ast' do

    it 'converts a single task definition as expected' do
      expr = <<-UNIT.strip
        task Task1 end
      UNIT
      expected = \
        [:unit_def,
          [:task_def, "Task1", [:nop]]]
      ast(expr, :unit_def).should eq(expected)
    end

    it 'accepts multiple task definitions' do
      expr = <<-UNIT.strip
        task Task1 end
        task Task2 end
      UNIT
      expected = \
        [:unit_def,
          [:task_def, "Task1", [:nop]],
          [:task_def, "Task2", [:nop]] ]
      ast(expr, :unit_def).should eq(expected)
    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
gisele-0.3.0 spec/unit/language/syntax/to_ast/test_unit_def.rb