From 946e7ee33bf9e385d518d9dd68ef8801623ca459 Mon Sep 17 00:00:00 2001 From: Evgeni Golov Date: Fri, 29 Nov 2024 08:23:55 +0100 Subject: [PATCH] assert exit status based on the generated updates --- test/unit/salt_runner_test.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/test/unit/salt_runner_test.rb b/test/unit/salt_runner_test.rb index 73111f0..101a68d 100644 --- a/test/unit/salt_runner_test.rb +++ b/test/unit/salt_runner_test.rb @@ -32,9 +32,13 @@ def test_capture_jid def test_override_exit_status runner = SaltRunner.new({}, :suspended_action => nil) assert_nil runner.jid - assert_equal 1, runner.publish_exit_status(0) + runner.publish_exit_status(0) + updates = runner.generate_updates + assert_equal 1, updates[{:suspended_action => nil}].exit_status runner.publish_data('jid: 12345', 'stdout') - assert_equal 0, runner.publish_exit_status(0) + runner.publish_exit_status(0) + updates = runner.generate_updates + assert_equal 0, updates[{:suspended_action => nil}].exit_status end def test_generate_command