From c0223545955ece96efe007d67706950825749833 Mon Sep 17 00:00:00 2001 From: Johnathan Martin Date: Thu, 11 Jan 2024 10:42:33 -0800 Subject: [PATCH] okcomputer spec touchups * fix a copypasta test title (and tweak its sibling) * extract a tiny bit of repeated code to a subject var for readability --- spec/config/okcomputer_spec.rb | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/spec/config/okcomputer_spec.rb b/spec/config/okcomputer_spec.rb index 418f3b83..a8928ff9 100644 --- a/spec/config/okcomputer_spec.rb +++ b/spec/config/okcomputer_spec.rb @@ -39,6 +39,8 @@ end describe RabbitQueueExistsCheck do + subject(:rabbit_queue_exists_check) { described_class.new([queue_name1, queue_name2]) } + let(:bunny_conn) { instance_double(Bunny::Session) } let(:queue_name1) { 'foo.first_queue' } let(:queue_name2) { 'foo.second_queue' } @@ -54,8 +56,8 @@ let(:queue_exists1) { true } let(:queue_exists2) { true } - it 'succeeds if the expected queue exists' do - expect(described_class.new([queue_name1, queue_name2])).to be_successful + it 'succeeds if the expected queues exist' do + expect(rabbit_queue_exists_check).to be_successful end end @@ -63,8 +65,8 @@ let(:queue_exists1) { true } let(:queue_exists2) { false } - it 'succeeds if the expected queue exists' do - expect(described_class.new([queue_name1, queue_name2])).not_to be_successful + it 'fails if an expected queue is missing' do + expect(rabbit_queue_exists_check).not_to be_successful end end end