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 arrange your specs into meaningful groups
  • How to “get the words right” with names for your groups
  • Where to put shared setup and teardown code

Chapter 7Structuring Code Examples

Now that you’ve used RSpec to design and build the beginnings of an application, you’ve got a mental model of “where things go.” You’ve written short, clear examples that explain exactly what the expected behavior of the code is. You’ve laid these examples out in logical groups—not only to share setup code, but to keep related specs together.

By the end of this chapter, you’ll be an organizational expert—for RSpec examples, at least. You’ll use RSpec’s flexible language to communicate your intent clearly when you organize your specs into groups. You’ll ...

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