test/functional/eft_6_concurrence.rb in ruote-2.1.7 vs test/functional/eft_6_concurrence.rb in ruote-2.1.8

- old
+ new

@@ -26,11 +26,11 @@ @tracer << "alpha\n" end #noisy - assert_trace pdef, %w[ alpha alpha ] + assert_trace %w[ alpha alpha ], pdef end def test_over_if pdef = Ruote.process_definition do @@ -59,11 +59,11 @@ nil end #noisy - assert_trace(pdef, %w[ alpha ] * 3) + assert_trace(%w[ alpha ] * 3, pdef) #assert_equal( # {'1'=>{"seen"=>"indeed"}, '0'=>{}, "params"=>{"ref"=>"bravo"}}, # fields) @@ -103,11 +103,11 @@ fields = workitem.fields end #noisy - assert_trace(pdef, %w[ a a done. ]) + assert_trace(%w[ a a done. ], pdef) end def test_remaining_forget_when_no_remains pdef = Ruote.process_definition do @@ -118,11 +118,11 @@ echo 'done.' end #noisy - assert_trace pdef, %w[ a b done. ], %w[ b a done. ] + assert_trace %w[ a b done. ], %w[ b a done. ], pdef end # helper # def run_concurrence (concurrence_attributes, noise) @@ -184,9 +184,22 @@ assert_equal(%w[ 0 1 params ], wi.fields.keys.collect { |k| k.to_s }.sort) assert_equal({ 'ref' => 'alpha' }, wi.fields['params']) assert_equal(%w[ seen ], wi.fields['0'].keys) assert_equal(%w[ seen ], wi.fields['1'].keys) + end + + def test_concurrence_merge_type_stack + + wi = run_concurrence({ :merge_type => :stack }, false) + + assert_equal( + %w[ params stack stack_attributes ], + wi.fields.keys.collect { |k| k.to_s }.sort) + + assert_equal({ 'ref' => 'alpha' }, wi.fields['params']) + assert_equal(%w[ seen ], wi.fields['stack'][0].keys) + assert_equal(%w[ seen ], wi.fields['stack'][1].keys) end # helper # def run_test_count (remaining, noise)