Sha256: d228310bcfd8bbbc39a7c85ce1c52fed2ecc5a3e7038a9fb40efff7fd183cad7

Contents?: true

Size: 1.28 KB

Versions: 2

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/reader/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

2 entries across 2 versions & 2 rubygems

Version Path
ruote-maestrodev-2.2.1 test/unit/ut_8_tree_to_dot.rb
ruote-2.2.0 test/unit/ut_8_tree_to_dot.rb