Sha256: e67d10578203989a6f86b07a426d6358362241fd8ebaceea81dee0c7e8d664ea

Contents?: true

Size: 1.28 KB

Versions: 11

Compression:

Stored size: 1.28 KB

Contents

#
# testing ruote
#
# Wed Jul 15 09:27:20 JST 2009
#

require File.join(File.dirname(__FILE__), '..', 'test_helper.rb')

require 'ruote/parser/ruby_dsl'
require 'ruote/tree_dot'


class TreeDotTest < Test::Unit::TestCase

  def test_sequence

    tree = Ruote.define :name => 'test' do
      sequence do
        alpha
        bravo
      end
    end

    #puts Ruote.tree_to_dot(tree)

    assert_equal(
      %{
digraph "ruote process definition" {
  "0" [ label = "define {'name'=>'test'}" ];
  "0_0" [ label = "sequence {}" ];
  "0_0_0" [ label = "alpha {}" ];
  "0_0_1" [ label = "bravo {}" ];
  "0_0" -> "0_0_0";
  "0_0_1" -> "0_0";
  "0_0_0" -> "0_0_1";
  "0" -> "0_0";
  "0_0" -> "0";
}
      }.strip,
      Ruote.tree_to_dot(tree).strip)
  end

  def test_concurrence

    tree = Ruote.define :name => 'test' do
      concurrence do
        alpha
        bravo
      end
    end

    #puts Ruote.tree_to_dot(tree)

    assert_equal(
      %{
digraph "ruote process definition" {
  "0" [ label = "define {'name'=>'test'}" ];
  "0_0" [ label = "concurrence {}" ];
  "0_0_0" [ label = "alpha {}" ];
  "0_0_1" [ label = "bravo {}" ];
  "0_0" -> "0_0_0";
  "0_0_0" -> "0_0";
  "0_0" -> "0_0_1";
  "0_0_1" -> "0_0";
  "0" -> "0_0";
  "0_0" -> "0";
}
      }.strip,
      Ruote.tree_to_dot(tree).strip)
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
ruote-2.1.11 test/unit/ut_8_tree_to_dot.rb
ruote-2.1.10 test/unit/ut_8_tree_to_dot.rb
ruote-2.1.9 test/unit/ut_8_tree_to_dot.rb
ruote-2.1.8 test/unit/ut_8_tree_to_dot.rb
ruote-2.1.7 test/unit/ut_8_tree_to_dot.rb
ruote-2.1.6 test/unit/ut_8_tree_to_dot.rb
ruote-2.1.5 test/unit/ut_8_tree_to_dot.rb
ruote-2.1.4 test/unit/ut_8_tree_to_dot.rb
ruote-2.1.3 test/unit/ut_8_tree_to_dot.rb
ruote-2.1.2 test/unit/ut_8_tree_to_dot.rb
ruote-2.1.1 test/unit/ut_8_tree_to_dot.rb