Sha256: c2112ba6d0d2f8ec5f2ffb54f44f8e8285aadb186b1c22191466ee44fc5c4574

Contents?: true

Size: 851 Bytes

Versions: 4

Compression:

Stored size: 851 Bytes

Contents

require 'spec_helper'
module Gisele::Language
  describe Grammar, 'task_def' do

    it 'parses a simple implicit task definition' do
      taskdef = <<-TASKDEF.strip
        task Process
          Diagnosis
        end
      TASKDEF
      parse(taskdef, :task_def).should eq(taskdef)
    end

    it 'allows any statement' do
      taskdef = <<-TASKDEF.strip
        task Process
          while true Diagnosis end
        end
      TASKDEF
      parse(taskdef, :task_def).should eq(taskdef)
    end

    it 'supports optional variable definitions in the signature' do
      taskdef = <<-TASKDEF.strip
        task Process
          fluent   diagKnown {Diagnosis:start}, {} initially false
          trackvar mplus     {Diagnosis:end}
          Diagnosis
        end
      TASKDEF
      parse(taskdef, :task_def).should eq(taskdef)
    end

  end
end

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
gisele-language-0.6.0 spec/language/syntax/grammar/test_task_def.rb
gisele-language-0.5.1 spec/language/syntax/grammar/test_task_def.rb
gisele-language-0.5.0 spec/language/syntax/grammar/test_task_def.rb
gisele-0.5.0 spec/unit/language/syntax/grammar/test_task_def.rb