feat(rspec): add RSpec test runner with compact output (Rails/Ruby)#198
Open
deril wants to merge 2 commits intortk-ai:masterfrom
Open
feat(rspec): add RSpec test runner with compact output (Rails/Ruby)#198deril wants to merge 2 commits intortk-ai:masterfrom
deril wants to merge 2 commits intortk-ai:masterfrom
Conversation
Adds `rtk rspec` command for Rails/Ruby test suites with 60-90% token savings. - Parse RSpec's `--format json` output (injected automatically) - Auto-detect `bundle exec rspec` when Gemfile contains "rspec" - Compact success: `✓ RSpec: 42 passed (0.12s)` - Failures show: test name, file:line, exception class + message, backtrace (gems stripped) - Cap at 5 failures inline, `... +N more` for the rest - Pending tests shown in count - Fallback text parser when JSON unavailable - 17 unit tests covering all paths and token savings assertions - Hook rewrites: `rspec`, `bundle exec rspec`, `bundle exec rails spec` → `rtk rspec` - Add mise.toml to pin Rust toolchain for mise users Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Rails projects using binstubs invoke `bin/rspec` instead of bare `rspec`. Add hook pattern so it gets rewritten to `rtk rspec` transparently. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Collaborator
|
Thanks for the contribution! Could you rebase on master? The branch is 2 commits behind. We'll review once it's up to date. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
rtk rspec— compact RSpec output for Rails/Ruby test suites--format jsonoutput and showing only what mattersrspec,bin/rspec,bundle exec rspec,bundle exec rails spec→rtk rspecHow it works
RSpec's
--format jsonis injected automatically (unless the user already passes--format). The JSON is parsed and reduced to:Or on failures:
Key details:
bundle exec rspecwhen a Gemfile mentioningrspecis presentbin/rspecsupported: Rails binstub pattern intercepted by hook/gems/andlib/rspecare skippedRSpec::Expectations::ExpectationNotMetError→ExpectationNotMetError... +N morefor the restTest plan
cargo fmt --all --checkcleancargo clippy --all-targetsclean (0 new warnings)attensi-backend)🤖 Generated with Claude Code