Refactor specs

This commit is contained in:
Manuel Bustillo 2024-08-01 20:46:11 +02:00
parent 2dd11bb83d
commit b21d323e36

View File

@ -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