Sha256: a2c20666a9c1fb01d680bb26b432e5a4bd66435471115ac4ef9ab9914f60cf39

Contents?: true

Size: 1.27 KB

Versions: 4

Compression:

Stored size: 1.27 KB

Contents

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

require File.expand_path('../../test_helper', __FILE__)

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

4 entries across 4 versions & 1 rubygems

Version Path
ruote-2.3.0.3 test/unit/ut_8_tree_to_dot.rb
ruote-2.3.0.2 test/unit/ut_8_tree_to_dot.rb
ruote-2.3.0.1 test/unit/ut_8_tree_to_dot.rb
ruote-2.3.0 test/unit/ut_8_tree_to_dot.rb