Sha256: 2839779d2375760ad4486424fede40f7b0147ee82555dd5f039d765439b7435d

Contents?: true

Size: 892 Bytes

Versions: 1

Compression:

Stored size: 892 Bytes

Contents

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

    it 'converts fluent definitions as expected' do
      defn     = "fluent diagKnown {Diagnosis:start, diagnosis}, {Treatment:end} initially false"
      expected = [:fluent,
                   "diagKnown",
                   [:event_set, "Diagnosis:start", "diagnosis"],
                   [:event_set, "Treatment:end"],
                   false]
      ast(defn, :fluent_def).should eq(expected)
    end

    it 'does not require the initial value' do
      defn     = "fluent diagKnown {Diagnosis:start, diagnosis}, {Treatment:end}"
      expected = [:fluent,
                   "diagKnown",
                   [:event_set, "Diagnosis:start", "diagnosis"],
                   [:event_set, "Treatment:end"],
                   nil]
      ast(defn, :fluent_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_fluent_def.rb