Content Formatter spec
require 'content_formatter' | |
describe ContentFormatter do | |
describe "awesome" | |
it "returns awesome when AW is given" do | |
text = "AW" | |
expect(ContentFormatter.awesome(text)).to eq("Awesome") | |
end | |
it "returns awesome when AW is given multiple times within random text" do | |
text = "blah blah blah AW blah AW blah" | |
expect(ContentFormatter.awesome(text)).to eq("blah blah blah Awesome blah Awesome blah") | |
end | |
it "returns awesome three times when AW is joined together three times" do | |
text = "AWAWAW" | |
expect(ContentFormatter.awesome(text)).to eq("AwesomeAwesomeAwesome") | |
end | |
it "returns nothing when nothing is given" do | |
text = "" | |
expect(ContentFormatter.awesome(text)).to eq("") | |
end | |
end |
This comment has been minimized.
This comment has been minimized.
Good thinking, will add to it. |
This comment has been minimized.
This comment has been minimized.
line 4 and 6 should be blank (rubocop should be shouting at you re this?) line 24 is good but you can inline it eg and you still haven't covered off Otherwise these are good to start making pass! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This comment has been minimized.
This is a good start. Can you think of any scenarios that the test doesn't cover (hint: nils, just AW, multiple AWAWAW together etc) ?