Created
September 1, 2016 21:44
-
-
Save evmorov/dd681d5dbe2d1f7a6d53c9a19e72a0e4 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
require 'rspec' | |
require_relative 'nickname' | |
describe Nickname do | |
describe '#generate' do | |
it { expect(subject.generate('Donald Knuth')).to eq('Donut') } | |
it { expect(subject.generate('Alan Turing')).to eq('Alanin, Anting') } | |
it { expect(subject.generate('Claude Shannon')).to eq('Clades, Cannon') } | |
it { expect(subject.generate('Ada Lovelace')).to eq('Aloe, Alec, Alee, Alae') } | |
it { expect(subject.generate('Haskell Curry')).to eq('Harry, Hurry, Herry') } | |
end | |
describe '#substrings' do | |
it { expect(subject.substrings('abcd')).to match_array(%w(abcd abc abd acd ab ac ad a)) } | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment