Skip to content

Instantly share code, notes, and snippets.

@caioertai
Created October 15, 2021 00:42
Show Gist options
  • Save caioertai/8cd54421409a8c1279ff5117608011fa to your computer and use it in GitHub Desktop.
Save caioertai/8cd54421409a8c1279ff5117608011fa to your computer and use it in GitHub Desktop.
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