From the course: Ruby: Testing with RSpec
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Challenge: StringExtend - Ruby Tutorial
From the course: Ruby: Testing with RSpec
Challenge: StringExtend
- If you did well with the NumberHelper challenge then you should have no problem with the StringExtend Challenge. If you did run into problems this'll give you another opportunity to try your hand at some simple RSpec examples. There are gonna be two methods that we're going to be writing examples for, titleize and #blank?. Titleize is pretty straightforward. You just call titleize on some sample Strings and see if you get the expected String back. Blank? is not that hard either, just note that it returns true or false. Remember in our Spec there is a difference between be true, be false, be_truthy and be_falsey. Also recall that we have predicate matchers that will allow us to use something like be_blank. It's up to you which one of these you use, just be mindful about the choice that you're making. Altogether there are 10 pending examples. It should take you approximately 15 minutes to complete them. The first thing you should do whenever you're writing methods is take a look at…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
-
-
-
(Locked)
Food-finder application6m 8s
-
(Locked)
Challenge: NumberHelper5m 49s
-
(Locked)
Solution: NumberHelper3m 8s
-
(Locked)
Challenge: StringExtend2m 6s
-
(Locked)
Solution: StringExtend3m 48s
-
(Locked)
Challenge: Restaurant5m 25s
-
(Locked)
Solution: Restaurant6m 30s
-
(Locked)
Challenge: Guide12m 49s
-
(Locked)
Solution: Guide6m 41s
-
(Locked)
-
-
-
-