rspec
Installation
SKILL.md
RSpec
RSpec is the primary testing tool for Ruby (especially Rails). It focuses on "Behavior Driven Development" (BDD), making tests read like documentation specifications.
When to Use
- Ruby on Rails BDD Testing: The standard Behavior-Driven Development testing framework for Ruby and Rails applications.
- Expressive Specification Design: Writing readable, self-documenting specifications using
describe,context, andit. - Database & Model Validation: Testing ActiveRecord validations, scopes, and associations with
shoulda-matchers. - Comprehensive Mocking & Stubbing: Isolating dependencies using
instance_doubleandallow().to receive().