Skip to content

Report where load errors were raised; support Ruby 2.7 and 3.0 - #10

Merged
trans merged 2 commits into
masterfrom
fix/load-error-output
Nov 17, 2026
Merged

trans merged 2 commits into
masterfrom
fix/load-error-output

Conversation

@trans

@trans trans commented Nov 17, 2026

Copy link
Copy Markdown
Member

Load errors

An error raised outside of a test, such as while a test file loads, ended the run with only ERROR: <message>: no class, file or line, and no hint that --debug shows the backtrace. That made a FrozenError in a project's own library look like a rubytest crash.

Test.run! now prints:

ERROR: FrozenError: can't modify frozen String: ""
  at /tmp/f.rb:2:in `boom'
(Use --debug, or ruby -d, for the full backtrace.)

--debug still re-raises with the full backtrace. A new section in demo/03_runner_reliability.md covers the report.

Ruby 2.7 and 3.0

0.9.0 set required_ruby_version to >= 3.1, but nothing in the code needs it. On Ruby 2.7 and 3.0 Bundler resolves ansi 1.5.0, qed 2.9.2 and ae 1.8.2, the last releases before those gems required 3.1.

With 0.9.0, a project that tests on Ruby older than 3.1 gets rubytest 0.8.1 there, which has no executable, so it has to keep rubytest-cli. On newer Rubies it then has two gems that ship rubytest, and Bundler warns. Lowering the floor lets such a project drop rubytest-cli.

The CI matrix gains 2.7 and 3.0.

Testing

  • bundle exec rake test on Ruby 3.4.9: 5 demos, 36 steps, 90 assertions, all passing.
  • The same, plus the rubytest executable on a test file and on a file that raises while loading, in ruby:2.7 (2.7.8) and ruby:3.0 (3.0.7) containers: all passing.

🤖 Generated with Claude Code

trans and others added 2 commits November 17, 2026 09:14
An error raised outside of a test, such as while a test file loads, ended
the run with only `ERROR: <message>`. Print the error's class, the first
backtrace line, and a pointer to --debug.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Nothing in the code needs 3.1. On older Rubies Bundler resolves ansi 1.5.0,
qed 2.9.2 and ae 1.8.2, the last releases before those gems required 3.1.
Add both versions to the CI matrix.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@trans
trans merged commit d6a60da into master Nov 17, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant