diff --git a/test/process_manager_test.rb b/test/process_manager_test.rb index 025113e..4af652b 100644 --- a/test/process_manager_test.rb +++ b/test/process_manager_test.rb @@ -91,6 +91,7 @@ class ProcessManagerTest end pm.stdin.add_data("10\n") pm.run! + assert_equal '', pm.stderr.to_s assert_equal pm.stdout.to_s.lines.map(&:chomp), %w[10 9 8 7 6 5 4 3 2 1 0] end end diff --git a/test/task_launcher_test.rb b/test/task_launcher_test.rb index 3b8bfc5..0b41d82 100644 --- a/test/task_launcher_test.rb +++ b/test/task_launcher_test.rb @@ -11,10 +11,8 @@ class TaskLauncherTest < Minitest::Spec class DummyDynflowAction < Dynflow::Action def plan(input) - callback input + plan_self received_input: input end - - def callback(_input); end end describe TaskLauncher do @@ -27,10 +25,8 @@ def callback(_input); end let(:launcher_class) { Single } it 'triggers an action' do - DummyDynflowAction.any_instance.expects(:callback).with do |arg| - Dynflow::Utils::IndifferentHash.new(arg) == expected_result - end - launcher.launch!(launcher_input) + plan = launcher.launch!(launcher_input).finished.value! + _(plan.entry_action.input[:received_input]).must_equal expected_result end it 'provides results' do @@ -44,10 +40,6 @@ def callback(_input); end let(:launcher_class) { Batch } it 'triggers the actions' do - DummyDynflowAction.any_instance.expects(:callback).with do |arg| - arg == expected_result - end.twice - parent = launcher.launch!('foo' => launcher_input, 'bar' => launcher_input) wait_until(iterations: 15, interval: 1) do load_execution_plan(parent[:task_id]).state == :stopped @@ -55,6 +47,9 @@ def callback(_input); end plan = load_execution_plan(parent[:task_id]) _(plan.result).must_equal :success _(plan.sub_plans.count).must_equal 2 + plan.sub_plans.each do |plan| + _(plan.entry_action.input[:received_input]).must_equal expected_result + end end it 'provides results' do