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:

  • What kind of information RSpec stores about each spec
  • How you can tag your examples with custom information
  • How to perform expensive setup only when you need to
  • How to run just a subset of your specs

Chapter 8Slicing and Dicing Specs with Metadata

Over the course of this book, you’ve followed a key principle that has made your specs faster, more reliable, and easier to use: run just the code you need. This principle shows up in several practices you’ve been using as you’ve followed along with the code examples:

  • When you’re isolating a failure, run just the failing example.
  • When you’re modifying a class, run just its unit tests.
  • When you’ve got expensive setup code, only run it for the specs where you need it.

A key piece of RSpec that’s ...

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