Skip to content

Instantly share code, notes, and snippets.

@SophiaPetrova
Last active October 22, 2016 20:30
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save SophiaPetrova/cc1b9313792482dd680fcb2545ec25d5 to your computer and use it in GitHub Desktop.
describe '#common_digits_count' do
it { expect(common_digits_count(567, 678)).to eq(2) }
it { expect(common_digits_count(123444, 3445)).to eq(2) }
it { expect(common_digits_count(456, -2358)).to eq(1) }
it { expect(common_digits_count(111, 111)).to eq(1) }
it { expect(common_digits_count(111, -111)).to eq(1) }
it { expect(common_digits_count(11221, -1121)).to eq(2) }
it { expect(common_digits_count(-11221, -1121)).to eq(2) }
it { expect(common_digits_count(1234, 56)).to eq(0) }
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment