rspec-testing

Write RSpec tests for Bike Index using context and let conventions.

308|76|Updated Jul 25, 2013
One-click install
npx skills add https://github.com/bikeindex/bike_index --skill rspec-testing-bikeindex
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: rspec-testing
Source: https://github.com/bikeindex/bike_index/tree/main/.claude/skills/rspec-testing
Command: npx skills add https://github.com/bikeindex/bike_index --skill rspec-testing-bikeindex

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

This Skill provides guidelines and best practices for writing efficient and maintainable RSpec tests in the Bike Index project.

Core Features & Use Cases

  • Testing Conventions: Offers recommendations on structuring and writing tests with context and let.
  • Avoiding Common Pitfalls: Helps developers avoid common mistakes like testing private methods and excessive mocking.
  • Quick Start: Trigger the skill when writing or modifying *_spec.rb files to ensure adherence to best practices.

Quick Start

To activate the skill when writing a new test, type: 'rspec-testing write new test for bike model'.

Frequently Asked Questions about rspec-testing

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

FAQPage Schema
What are the best practices for structuring RSpec tests with context and let?

RSpec test best practices involve using `context` blocks to isolate specific scenarios and `let` blocks for lazy variable evaluation to improve test readability and maintainability. Structuring tests this way keeps your suite organized and prevents duplication.

How do I write a new RSpec test for a Bike Index model?

To write a new RSpec test for a Bike Index model, trigger the skill when modifying `*_spec.rb` files to automatically apply structured test guidelines and examples. This ensures your new tests adhere to project-specific conventions and maintain high code quality.

Why should I avoid testing private methods and excessive mocking in RSpec?

Avoiding testing private methods and excessive mocking in RSpec prevents brittle tests that break during internal refactoring. Focusing on public interfaces and minimizing mocks ensures your test suite accurately validates behavior without being tightly coupled to implementation details.

When do I need RSpec test guidelines for the Bike Index project?

You need RSpec test guidelines for the Bike Index project whenever you are writing or modifying `*_spec.rb` files to ensure proper testing conventions. Applying these guidelines during active development maintains code quality and consistency across the entire project.