Your Turn

In this chapter, we went over the major pieces of the software we’re building. You used Bundler to manage all of your project’s dependencies, including RSpec. You wrote your first spec to drive the app from its outermost layer, the HTTP interface, then wrote just enough Ruby code to get an idea of what the business logic needs to look like.

Next, we’ll narrow our focus to the HTTP routing logic, and test it in isolation from the rest of the system.

Exercises

  1. Skim through the introductory Sinatra documentation to get a feel for how apps are structured.[33]

  2. Read “Testing Sinatra with Rack::Test” to learn the testing approach favored by the Sinatra team.[34]

  3. Remember the spec_helper.rb file that RSpec generated for you? Read through a ...

Get Effective Testing with RSpec 3 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.