test
From davila7
Create comprehensive test files with RSpec or Minitest following Ruby testing best practices.
Install
/testFacts
- Repository
- davila7/claude-code-templates
- Status
- Actively maintained
- Last commit
- Source file
- .claude/commands/test.md
Source preview
The instructions Claude Code reads when this command runs.
# Ruby Test Generator
Create comprehensive test files with RSpec or Minitest following Ruby testing best practices.
## Purpose
This command helps you quickly create test files with proper structure, examples, and testing patterns for Ruby applications.
## Usage
```
/test
```
## What this command does
1. **Creates test files** with proper structure for RSpec or Minitest
2. **Includes test examples** for common scenarios
3. **Sets up test helpers** and support files
4. **Follows testing conventions** and best practices
5. **Generates factory/fixture data** when needed
## RSpec Example Output
```ruby
# spec/models/user_spec.rb
require 'spec_helper'
RSpec.describe User do
let(:user) { build(:user) }
let(:valid_attributes) do
{
name: 'John Doe',
email: '[email protected]',
age: 30
}
end
describe 'validations' do
it { should validate_presence_of(:name) }
it { should validate_presence_of(:email) }
it { should validate_uniqueness_of(:email) }
it { should validate_numericality_of(:age).is_greater_than(0) }
context 'when email format is invalid' do
let(:user) { build(:user, email: 'invalid-email') }
it 'is not valid' do
expect(user).not_to be_valid
expect(user.errors[:email]).to include('is invalid')
end
end
end
describe 'associations' do
it { should have_many(:pView full source on GitHub →Other slash commands
feature-development
★ 229,918Workflow command scaffold for feature-development in everything-claude-code.
affaan-mupdated 14d agoMITdatabase-migration
★ 229,918Workflow command scaffold for database-migration in everything-claude-code.
affaan-mupdated 14d agoMITadd-language-rules
★ 229,918Workflow command scaffold for add-language-rules in everything-claude-code.
affaan-mupdated 14d agoMITcommit-push-pr
★ 137,934Commit, push, and open a PR
anthropicsupdated 13d agodedupe
★ 137,934Find duplicate GitHub issues
anthropicsupdated 13d agotriage-issue
★ 137,934Triage GitHub issues by analyzing and applying labels
anthropicsupdated 13d ago