Created
October 15, 2021 00:42
-
-
Save caioertai/8cd54421409a8c1279ff5117608011fa 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
def acronymizer(sentence) | |
sentence.split.map { |word| word[0] }.join.upcase | |
end | |
describe "#acronymizer" do | |
it "Test case with empty sentence" do | |
actual = acronymizer("") | |
expect(actual).to eq("") | |
end | |
it "Test case with 'way too fast bitch'" do | |
actual = acronymizer("way too fast bitch") | |
expect(actual).to eq("WTFB") | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment