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

We cover:

  • How to set up a database for testing, without damaging your real data
  • Techniques for organizing shared and global setup code
  • How to use metadata to control how RSpec runs certain specs
  • How to diagnose an ordering dependency between your specs

Chapter 6Getting Real: Integration Specs

By now, you’ve got a solid HTTP routing layer designed with the help of unit specs. To write these unit specs, you isolated the code under test. Your specs assumed that the underlying dependencies would eventually be implemented, and provided test doubles—fake versions for the test.

Now, it’s time to write those dependencies for real. In this chapter, you’re going to implement the Ledger class as the bottom layer of the app. You’ll write code to store expense ...

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