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

Challenge: StringExtend - Ruby Tutorial

From the course: Ruby: Testing with RSpec

Start my 1-month free trial

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…

Contents