From 6075955323b23d742f2963a59b370b337512eb45 Mon Sep 17 00:00:00 2001 From: Stephen Paul Weber Date: Wed, 22 Sep 2021 12:48:42 -0500 Subject: [PATCH] Fix test so you get a better error on failure --- test/test_registration.rb | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/test/test_registration.rb b/test/test_registration.rb index 04c66a0..462267a 100644 --- a/test/test_registration.rb +++ b/test/test_registration.rb @@ -631,22 +631,23 @@ class RegistrationTest < Minitest::Test RESPONSE - Command::COMMAND_MANAGER.expect( - :write, - EMPromise.reject(:test_result), - [Matching.new do |iq| - assert_equal :form, iq.form.type - assert_equal( - "The JMP number +15555550000 is no longer available.", - iq.form.instructions - ) - end] - ) + result = execute_command do + Command::COMMAND_MANAGER.expect( + :write, + EMPromise.reject(:test_result), + [Matching.new do |iq| + assert_equal :form, iq.form.type + assert_equal( + "The JMP number +15555550000 is no longer available.", + iq.form.instructions + ) + end] + ) - assert_equal( - :test_result, - execute_command { @finish.write.catch { |e| e } } - ) + @finish.write.catch { |e| e } + end + + assert_equal :test_result, result assert_mock Command::COMMAND_MANAGER assert_instance_of( TelSelections::ChooseTel, -- 2.45.2