← ClaudeAtlas

rails-clean-test-outputlisted

Systematically eliminate unexpected output (warnings, stray puts/p/pp, deprecation notices) from a Rails test suite, one issue at a time, with per-fix verification and commits. Works for both RSpec (`bundle exec rspec`) and Minitest (`bin/rails test`) - detect which the project uses and adapt. Use whenever the user wants to clean up, silence, fix, or investigate noisy test output, mentions warnings or stray logs during test runs, or asks to get their suite running "clean" - e.g. "my test output is noisy", "there's a bunch of warnings when I run specs/tests", "help me clean up the test output".
mickzijdel/rails-toolkit · ★ 0 · AI & Automation · score 70
Install: claude install-skill mickzijdel/rails-toolkit
# Clean Up Unexpected Rails Test Output This skill wraps thoughtbot's [`clean-rspec-output`](https://github.com/thoughtbot/clean-rspec-output), vendored in this plugin at `../../vendor/clean-rspec-output/`. That skill is the authoritative, detailed per-issue workflow (capture → scan → isolate → fix → verify → simplify → commit). This wrapper adds two things on top: 1. **It is framework-agnostic.** The vendored workflow is written for RSpec, but the same approach works for Minitest. Detect which the project uses and translate the commands. 2. **Logging `p`/`puts` calls become logger calls, not deletions.** See Override B below. ## Step 0 — Detect the test framework Before anything else, determine which framework the repo uses, and say which you detected: - **RSpec** if the `Gemfile`/`Gemfile.lock` includes `rspec-rails` and there is a `spec/` directory. - **Minitest** otherwise (a `test/` directory with `minitest`, the Rails default). If both are present, ask the user which suite they want cleaned. ## The workflow Read and follow `../../vendor/clean-rspec-output/SKILL.md` end to end — its fix-scope rules (change *how* a test runs, never *what* it covers), its hard gate on reproducing each issue in isolation before fixing, its one-fix-per-commit discipline, and its commit-message format all apply unchanged. The two overrides below take precedence wherever they conflict with it. ## Override A — Minitest command map The vendored workflow hardcodes `bundle exec rspec`