Last active
April 12, 2023 17:03
-
-
Save SophiaPetrova/80906f4707de6188302e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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