From b21d323e364474e7ae3310f756f6bc7e29027a1b Mon Sep 17 00:00:00 2001 From: Manuel Bustillo Date: Thu, 1 Aug 2024 20:46:11 +0200 Subject: [PATCH] Refactor specs --- spec/services/tables/swap_spec.rb | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/spec/services/tables/swap_spec.rb b/spec/services/tables/swap_spec.rb index bd246e2..c2c68cb 100644 --- a/spec/services/tables/swap_spec.rb +++ b/spec/services/tables/swap_spec.rb @@ -18,15 +18,13 @@ module Tables acc end - it 'yields all possible swaps' do - expect(swaps.count).to eq(4) - end - - it 'swaps the people' do - expect(swaps).to include([%i[a d], %i[c b]]) - expect(swaps).to include([%i[b c], %i[d a]]) - expect(swaps).to include([%i[a c], %i[d b]]) - expect(swaps).to include([%i[b d], %i[c a]]) + it 'yields all possible swaps between the tables' do + expect(swaps).to contain_exactly( + [%i[a d], %i[c b]], + [%i[b c], %i[d a]], + [%i[a c], %i[d b]], + [%i[b d], %i[c a]] + ) end end end