Test request: $ARGUMENTS
Runs RSpec or Minitest tests based on project structure and analyzes results with fix suggestions.
/plugin marketplace add bastos/rails-plugin/plugin install bastos-ruby-on-rails@bastos/rails-pluginTest request: $ARGUMENTS
First, detect the testing framework:
spec/ directory and spec_helper.rb → RSpectest/ directory and test_helper.rb → Minitestrspec-rails or minitestBased on detected framework, run appropriate commands:
| Pattern | Command |
|---|---|
| All tests | bundle exec rspec |
| Single file | bundle exec rspec spec/models/user_spec.rb |
| Single test | bundle exec rspec spec/models/user_spec.rb:25 |
| By tag | bundle exec rspec --tag focus |
| Failed only | bundle exec rspec --only-failures |
| Directory | bundle exec rspec spec/models/ |
| Pattern | Command |
|---|---|
| All tests | rails test |
| Single file | rails test test/models/user_test.rb |
| Single test | rails test test/models/user_test.rb:25 |
| System tests | rails test:system |
| Directory | rails test test/models/ |
For the requested test run:
Parse arguments to determine:
Run the tests using appropriate command
Analyze results:
For failing tests, provide:
Quick shortcuts:
failed: Re-run only failed testsIf tests are failing, analyze the output and provide actionable fixes.