We cover:

  • How to install RSpec and write your first spec
  • How to organize your specifications using describe and it
  • How to verify desired outcomes with expect
  • How to interpret test failures
  • How to keep your specs free of repeated setup code

Chapter 1Getting Started With RSpec

RSpec 3 is a productive Ruby test framework. We say productive because everything about it—its style, API, libraries, and settings—are designed to support you as you write great software.

Writing effective tests helps you toward that goal of shipping your application. We have a specific definition of effective here: does this test pay for the cost of writing and running it? A good test will provide at least one of these benefits:

  • Design guidance: helping you distill all those ...

Get Effective Testing with RSpec 3 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.