Sha256: d95ec8a2cc274f7acdb303627362e1b967930275afc6d587209fe44fa6edc04d
Contents?: true
Size: 1.89 KB
Versions: 7
Compression:
Stored size: 1.89 KB
Contents
# # testing ruote # # Fri Sep 11 16:09:32 JST 2009 # require File.join(File.dirname(__FILE__), 'base') class EftAddBranchesTest < Test::Unit::TestCase include FunctionalBase def test_add_branches pdef = Ruote.process_definition :name => 'test' do concurrent_iterator :on => 'a, b' do sequence do echo '${v:i}' add_branches 'c, d', :if => '${v:ii} == 0' end end end #noisy wfid = @engine.launch(pdef) wait_for(wfid) assert_equal %w[ a b c d ], @tracer.to_a.sort end def test_add_branches_times pdef = Ruote.process_definition :name => 'test' do concurrent_iterator :times => 3 do sequence do echo '${v:i}' add_branches 2, :if => '${v:i} == 1' end end end #noisy wfid = @engine.launch(pdef) wait_for(wfid) assert_equal %w[ 1 2 3 4 5 ], @tracer.to_a.sort end def test_add_branches_times_and_whatever pdef = Ruote.process_definition :name => 'test' do concurrent_iterator :times => 3 do sequence do echo '${v:i}' add_branches 'a, b', :if => '${v:i} == 1' end end end #noisy wfid = @engine.launch(pdef) wait_for(wfid) assert_equal %w[ 1 2 3 a b ], @tracer.to_a.sort end def test_add_branches_with_tag pdef = Ruote.process_definition :name => 'test' do concurrent_iterator :on => 'a, b', :to_v => 'x', :tag => 'here' do sequence do echo '<:${v:x}' concurrent_iterator :on => '0, 1' do sequence do echo '>:${v:i}' add_branch 'c', :ref => 'here', :if => '${v:x} == a' end end end end end #noisy wfid = @engine.launch(pdef) wait_for(wfid) assert_equal( %w[ <:a <:b <:c <:c >:0 >:0 >:0 >:0 >:1 >:1 >:1 >:1 ], @tracer.to_a.sort) end end
Version data entries
7 entries across 7 versions & 2 rubygems