Skip to content

conformance: implement complain/output mspec matchers (+219, floor 19009) - #574

Merged
tannevaled merged 2 commits into
mainfrom
chore/shim-complain-output
Sep 6, 2026
Merged

tannevaled merged 2 commits into
mainfrom
chore/shim-complain-output

Conversation

@tannevaled

Copy link
Copy Markdown
Contributor

The ratchet shim stubbed complain/output/output_to_fd as SpecSkip, so every example using .should_not complain, .should complain(/…/) or .should output(…) was skipped — 68 corpus files use complain, 12 use output. This implements ComplainMatcher and OutputMatcher (capture $stderr/$stdout via StringIO around the block, String-exact / Regexp match, complain's verbose: keyword), mirroring mspec. rbgo already supports $stdout/$stderr → StringIO reassignment (wave-11), so capture is exact. output_to_fd stays unsupported.

Measured 19009 passing (up from 18790, +219); files loaded 2164 / failed-to-load 42 unchanged (no load regression). The floor is bumped in the same PR because it depends on the new shim; CI's ratchet runs at TIMEOUT=60 (> the local 25s) so it measures at least the local total.

🤖 Generated with Claude Code

tannevaled and others added 2 commits September 6, 2026 13:02
…9009

The ratchet shim stubbed complain/output/output_to_fd as SpecSkip, so every
example using `.should_not complain`, `.should complain(/…/)` or
`.should output(…)` was skipped — 68 corpus files use complain, 12 use output.
Implement ComplainMatcher and OutputMatcher (capture $stderr/$stdout via
StringIO around the block, match a String exactly or a Regexp, honour
complain's verbose: keyword), mirroring mspec's matchers. rbgo already supports
$stdout/$stderr reassignment to a StringIO (wave-11), so the capture is exact.
output_to_fd (real fd redirection) stays unsupported.

Measured 19009 passing on the pinned corpus (up from 18790, +219), files
loaded 2164 / failed-to-load 42 both unchanged (no load regression). CI's
ratchet runs at TIMEOUT=60 (more lenient than the local 25s), so it measures at
least the local total.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Read ruby/mspec's lib/mspec/matchers/complain.rb: the real matcher runs the
block under $VERBOSE = false by default (or the given verbose: value) and
still requires a non-empty warning even after a constraining pattern matches
(it ends on warning.empty? ? false : true). Our lenient version left $VERBOSE
at the ambient level and returned the bare pattern comparison, which counted
one example that only passes because the matcher was looser than real mspec —
a false pass masking an rbgo warning-level nonconformance. Faithful total is
19008 (one honest example below the lenient 19009).

Also drops a peer-added always-true ComplainMatcher stub that this class
fully overrode, leaving a single coherent definition.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@tannevaled
tannevaled merged commit ed5cc9a into main Sep 6, 2026
7 checks passed
@tannevaled
tannevaled deleted the chore/shim-complain-output branch September 6, 2026 12:05
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