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: Restaurant

Challenge: Restaurant - Ruby Tutorial

From the course: Ruby: Testing with RSpec

Start my 1-month free trial

Challenge: Restaurant

- Our next challenge is to try to write the specs for our Restaurant class. Make no mistake about it, this is going to be harder than the last two challenges that we've tried. In this challenge, we're going to be making use of a few more concepts. You're going to see the use of let, subject, whether explicitly defined or implicitly defined, pending, and we're going to make use of the helper method, no_output. You'll recall that we added that to our other project when we talked about helpers. Well, it's going to show up in this project as well. All together, there are 22 pending examples that you need to work on, and I would estimate that it's going to take you approximately 45 minutes to an hour to complete. Let's take a look at the code, so we can see the work that's ahead. So here I am in the actual Restaurant class itself. The first place to start, I think, is to look at that code, and see the scope of what we need to write tests for. We have this attribute accessor here, for the…

Contents