RSpec is a behavior-driven development (BDD) framework for the Ruby programming language. RSpec is widely used as the default testing tool in the Ruby community alongside Minitest, and it features a remarkably expressive matcher language — read a spec aloud and it sounds like prose.
The framework is split into focused gems: rspec-core (runner and CLI), rspec-expectations (matchers), rspec-mocks (test doubles), and rspec-rails for first-class Rails integration.
Behavior-driven development for Ruby. Expressive matchers, focused tests, readable specs.
✨ Features
expect(user).to be_valid. expect { ... }.to change(...).by(1). Reads like English.
rspec-mocks for mocks, stubs, spies, and instance doubles that verify against real classes.
describe/context blocks, shared examples and contexts. DRY large suites without losing clarity.
rspec-rails provides request, controller, system, mailer, and ActiveJob spec types.
Tag examples, run only focused ones, parallelize across cores or CI nodes.