home / skills / fortiumpartners / ai-mesh / rspec-test
This skill executes and generates RSpec tests for Ruby projects, including let bindings and before hooks, with mocking support.
npx playbooks add skill fortiumpartners/ai-mesh --skill rspec-testReview the files below or copy the command above to add this skill to your agents.
---
name: RSpec Test Framework
description: Execute and generate RSpec tests for Ruby projects with let bindings, before hooks, and mocking support
version: 1.0.0
---
# RSpec Test Framework
## Purpose
Provide RSpec test execution and generation for Ruby projects.
## Usage
```bash
ruby generate-test.rb --source=lib/calculator.rb --output=spec/calculator_spec.rb --description="Division by zero"
ruby run-test.rb --file=spec/calculator_spec.rb
```
## Output Format
JSON with success, passed, failed, total, and failures array.
This skill executes and generates RSpec tests for Ruby projects, including support for let bindings, before hooks, and mocking. It automates test creation from source files and runs specs, returning structured JSON results for integration with CI and agent workflows. It is designed to speed up writing focused unit tests and to produce machine-readable test outcomes.
The skill analyzes Ruby source files to scaffold RSpec examples and helper blocks (let, before) that capture common setup. It can generate spec files from given source paths and descriptions, and it runs RSpec on specific spec files or suites. Test runs produce JSON with overall success, counts for passed/failed/total, and an array of failure details for easy parsing.
What does the test runner output look like?
The runner returns JSON with success boolean, passed, failed, total counts, and a failures array with details for each failed example.
Can it generate tests that use mocks and stubs?
Yes. The generator can scaffold examples that set up mocks and stubs for dependencies so tests remain isolated and fast.