O'Reilly logo

Effective Testing with RSpec 3 by Myron Marston, Ian Dees

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required