rspec-fundamentals

Guide RSpec configuration and describe, context, it blocks with matchers.

187|20|Updated Nov 20, 2025
One-click install
npx skills add https://github.com/TheBushidoCollective/han --skill rspec-fundamentals
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: rspec-fundamentals
Source: https://github.com/TheBushidoCollective/han/tree/main/jutsu/jutsu-rspec/skills/rspec-fundamentals
Command: npx skills add https://github.com/TheBushidoCollective/han --skill rspec-fundamentals

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides comprehensive coverage of RSpec fundamentals, including describe, context, it blocks, let, and basic matchers for BDD testing.

Core Features & Use Cases

  • Describe/Context: Organize tests with clarity.
  • Let & Doubles: Manage test data and mocks.
  • Matchers: Validate behavior with core matchers.

Quick Start

Write a simple RSpec suite with describe, let, and an example using expect.

Frequently Asked Questions about rspec-fundamentals

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I set up RSpec testing in a Ruby project?▼

RSpec is a BDD testing framework for Ruby that uses describe, context, and it blocks to organize tests. Install the gem, run `rspec --init` to generate configuration files, and configure your spec_helper.rb to load dependencies and set up test environments.

What's the difference between describe, context, and it blocks in RSpec?▼

Describe blocks group related tests by class or method. Context blocks organize tests by a specific condition or state within a describe block. It blocks define individual test cases that run assertions using expect statements and matchers.

How do I use let to manage test data in RSpec?▼

Let defines reusable test variables that are evaluated lazily before each test runs. Use `let(:variable) { value }` to create a variable accessible throughout your describe or context block, reducing duplication and improving test readability.

What are RSpec matchers and how do I use them?▼

Matchers are assertions that validate behavior in expect statements. Core matchers include `eq`, `be`, `include`, and `raise_error`. Combine them with expect to write readable assertions like `expect(object).to eq(value)` or `expect { code }.to raise_error`.

Can I integrate RSpec with continuous integration pipelines?▼

Yes, RSpec integrates with CI systems by running `rspec` in your build pipeline to generate test reports. Configure formatters like `--format documentation` and `--format json` to produce output that CI tools parse for pass/fail status and metrics.

Do I need to learn mocking before using RSpec matchers?▼

No, basic matchers work with real objects and values. Mocking and doubles are optional techniques for isolating units of code. Start with core matchers like `eq` and `include`, then introduce doubles when tests require controlling external dependencies.