Sha256: 0e5b96bf891b4a2b85e2134e6f17f0f797109bc94f1dbb63e188a359b6859aae

Contents?: true

Size: 1.27 KB

Versions: 4

Compression:

Stored size: 1.27 KB

Contents

#
# testing ruote
#
# Sat Jan 24 22:40:35 JST 2009
#

require File.join(File.dirname(__FILE__), 'base')

require 'ruote/part/hash_participant'


class EftProcessDefinitionTest < Test::Unit::TestCase
  include FunctionalBase

  def test_empty_procdef

    assert_trace(
      Ruote.define(:name => 'test_1') { },
      '')
  end

  def test_sub_definition

    pdef = Ruote.process_definition :name => 'main' do
      define :name => 'sub0' do
      end
      participant :ref => :alpha
    end

    alpha = @engine.register_participant :alpha, Ruote::HashParticipant

    #noisy

    wfid = @engine.launch(pdef)

    wait_for(:alpha)

    ps = @engine.process(wfid)

    assert_equal(
      {"sub0"=> ["0_0", ["define", {"name"=>"sub0"}, []]],
       "main"=> ["0", ["define", {"name"=>"main"}, [["define", {"name"=>"sub0"}, []], ["participant", {"ref"=>"alpha"}, []]]]]},
      ps.variables)
  end

  #def test_define_implicit_name
  #  pdef = Ruote.define 'accounting_process' do
  #  end
  #  assert_equal 'accounting_process', pdef[1]['name']
  #end

  def test_sub_define_implicit_name

    pdef = Ruote.define 'accounting_process' do
      define 'sub0' do
      end
    end

    assert_equal(
      ["define", {"accounting_process"=>nil}, [["define", {"sub0"=>nil}, []]]],
      pdef)
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
ruote-2.1.7 test/functional/eft_0_process_definition.rb
ruote-2.1.6 test/functional/eft_0_process_definition.rb
ruote-2.1.5 test/functional/eft_0_process_definition.rb
ruote-2.1.4 test/functional/eft_0_process_definition.rb