Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
describe 'remove_duplicates' do
it 'removes duplicates' do
expect(remove_duplicates [-2, 12, 33, -2, 42, -2, 4, 8, 4, 13, 12]).
to eq [-2, 12, 33, 42, 4, 8, 13]
expect(remove_duplicates [-1, 4, -1, 33, 33, 42, 4]).
to eq [-1, 4, 33, 42]
expect(remove_duplicates [0, 7, 8, 7, 8, 78, 0, 2, 4, 6]).
to eq [0, 7, 8, 78, 2, 4, 6]
end
it 'returns empty array' do
expect(remove_duplicates []).
to eq []
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment