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 your specs can give you confidence in your code
  • How a good test suite makes refactoring possible
  • How to guide your design using your specs with behavior-driven development (BDD)

Chapter 3The RSpec Way

Over the last couple of chapters, you’ve gotten to know RSpec. You’ve written your first few examples and organized them into groups. You’ve seen how to run just a filtered subset of your specs and how to customize output.

All these features of RSpec are designed to make certain habits easy:

  • Writing examples that clearly spell out the expected behavior of the code
  • Separating common setup code from the actual test logic
  • Focusing on just what you need to do to make the next spec pass

None of these habits comes without a cost:

  • Writing ...

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