ruby-testing

Generates RSpec tests, configurations, and coverage workflows for Ruby projects.

Updated Jul 6, 2026
One-click install
npx skills add https://github.com/chenziyang110/launchdeck --skill ruby-testing-chenziyang110
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: ruby-testing
Source: https://github.com/chenziyang110/launchdeck/tree/main/.claude/skills/ruby-testing
Command: npx skills add https://github.com/chenziyang110/launchdeck --skill ruby-testing-chenziyang110

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Writing and maintaining Ruby tests requires deep knowledge of RSpec conventions, mocking strategies, and flaky-test guardrails. This Skill guides an AI agent through a structured five-phase workflow to produce correct, idiomatic RSpec test code and diagnose failures. ## Core Features & Use Cases - Test Generation: Produces unit, request, and model specs using RSpec, factory_bot, VCR, and shoulda-matchers with a defined output structure. - Failure Diagnosis: Provides debugging steps for failing or flaky tests, including seed reproduction, --only-failures reruns, and DatabaseCleaner isolation. - Coverage & CI Setup: Configures SimpleCov coverage gates and GitHub Actions workflows for automated test runs. - Use Case: Ask the agent to write request specs for a Rails Users API endpoint, and it will analyze the code, select a mocking strategy, and output runnable specs with run commands. ## Quick Start Ask the agent to write RSpec tests for a specific Ruby class or Rails endpoint in your project.

Frequently Asked Questions about ruby-testing

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

FAQPage Schema
How do I write RSpec tests for a Ruby class?▼

Use RSpec.describe blocks with describe, context, and it for behavior organization, and expect syntax for assertions. The skill generates specs following AAA structure with let and subject for lazy setup, runnable via bundle exec rspec.

How to mock external services in RSpec tests?▼

Use instance_double with allow and expect to stub or verify calls at service boundaries. For HTTP interactions, record real responses with VCR cassettes instead of hand-written stubs, and enable verify_partial_doubles in spec_helper.

RSpec vs Minitest for Ruby testing?▼

RSpec offers BDD-style describe/it syntax, rich matchers, and built-in mocking, making it the dominant choice for Rails apps. Minitest is Ruby's built-in framework, simpler and faster, suited for smaller projects or minimal dependencies.

Why are my RSpec tests flaky and how to fix them?▼

Flakiness usually comes from database state leakage, time dependence, or test ordering. Use DatabaseCleaner with truncation, Timecop or travel_to for time freezing, and run with --order random plus --seed to reproduce failures.

When should I not use this Ruby testing skill?▼

Avoid it for general Ruby feature implementation without test context, gem or bundler issues, and Ruby version management. It also stops and asks when no test framework exists, dependencies are missing, or tests would need production credentials.