Skip to content

Fix TAP-Y/J crash on an exception with no usable backtrace - #16

Merged
trans merged 1 commit into
masterfrom
fix/reporter-empty-backtrace
Nov 20, 2026
Merged

trans merged 1 commit into
masterfrom
fix/reporter-empty-backtrace

Conversation

@trans

@trans trans commented Nov 20, 2026

Copy link
Copy Markdown
Member

rubytest -y and -j raised NoMethodError: undefined method 'file' for nil for a failed, errored or pending test whose exception had no backtrace line outside the test framework. The run then ended early with wrong counts.

Lemon produces such an exception when a test doesn't call the method it covers ("upcase not tested"), so a Lemon suite with a pending test of that kind hit this. Found while running tapout's reporters against rubytest 0.11.0. The other reporters (dotprogress, progress, outline, summary, tap, html) already handled it.

The record now has the exception's message without file, line, source and snippet.

A demo step covers it; qed passes (6 demos, 48 steps) on Ruby 3.4.9.

🤖 Generated with Claude Code

The reporters asked for the source snippet of every failed, errored or
pending test's exception, and raised NoMethodError when there was none:
that is, when every backtrace line belonged to the test framework, as
with Lemon's "not tested" pending tests. The run ended early and the
counts were wrong. The record now carries the message alone.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@trans
trans merged commit 2e9f7c9 into master Nov 20, 2026
6 checks passed
@trans trans mentioned this pull request Nov 21, 2026
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