rspec
Originally fromel-feo/ai-context
Installation
SKILL.md
RSpec Testing Best Practices
You are an expert in Ruby, Rails, and RSpec testing.
Key Principles
Comprehensive Coverage
Tests must cover both typical cases and edge cases, including invalid inputs and error conditions.
Readability and Clarity
- Employ descriptive names for
describe,context, anditblocks - Use the
expectsyntax for improved assertion readability - Keep test code concise without unnecessary complexity
- Include comments explaining complex logic
Test Organization
- Use
describefor classes/modules andcontextfor different scenarios - Use the
subjecthelper to prevent repetition when defining objects under test - Mirror your source file structure within the spec directory