Repository navigation
Add support for Ruby 3.4 and 4.0 - #29
Merged
Merged
Conversation
rosston
added this pull request to stack #30
September 18, 2026 18:55
rosston
marked this pull request as ready for review
September 18, 2026 19:11
Ruby 3.4 changed backtrace frames from `` `method' `` to `` 'Class#method' ``.
Debug.guard_against_mocktail_accidentally_calling_mocks_if_debugging!
pattern-matched on the literal old backtick format to detect frames
inside a stubs { }.with { } block, so under Ruby 3.4+ it would
misidentify call sites and could raise a spurious "Unauthorized
internal call" error. Match either quote style instead.
Update explain_test.rb's hardcoded call-site expectations to match
the current Ruby's actual backtrace format rather than assuming the
pre-3.4 style.
Ruby 3.4 added __id__ to the set of methods it warns about when
redefined ("redefining '__id__' may cause serious problems"). This
test fixture already excludes __send__/object_id/nil?/is_a? for the
same reason; add __id__ to that list too.
minitest 5.25.5 and unicode-emoji 4.0.4 (locked, transitively via unicode-display_width) both declare required_ruby_version excluding Ruby 4.0 (`< 4.0`). Do a targeted `bundle update minitest unicode-emoji --conservative` in each affected project rather than a full re-lock, which wanted to jump simplecov 0.22->1.3 and tapioca 0.16->0.19 -- far more than this needs. Pin minitest to "~> 5.26" everywhere it's declared so it can't drift to the 6.0 line on a future update, since minitest 6.0+ requires Ruby >= 3.2 and would break Ruby 3.1.
Add test/support/version_helper.rb (ported from #26) as a shared place for that Ruby-version check, and use it in both stringifies_call_test.rb and explain_test.rb.
CI on Ruby 4.0 was failing: `gem install bundler` (unpinned) grabs whatever the latest bundler is, and on Ruby 4.0 that's the 4.x line, which requires Ruby >= 3.2 and can't be used as the project's pinned Bundler version without breaking Ruby 3.1. Using the older, pinned Bundler (2.x, needed for 3.1 support) against Ruby 4.0's newer built-in RubyGems triggers "already initialized constant Gem::Platform::*" warnings on STDERR -- reproduced with a clean `ruby:4.0` container and confirmed it isn't specific to any one Bundler 2.6.x patch. script/test_double_require_warnings asserted STDERR matched Mocktail's warning message exactly, so this incidental noise broke the assertion. Filter out lines matching Ruby's own "path:line: warning: message" format before comparing, since Mocktail's warning (emitted via plain `warn`) never has that prefix.
rosston
force-pushed
the
more-ruby-versions
branch
from
September 18, 2026 19:19
601aea6 to
ef8e450
Compare
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.
Supersedes #26
This is a large diff, but most of it is
.rbifile updates.In implementation code, the only things changed were matching both backtick (Ruby < 3.4) and single quote (Ruby >= 3.4) in
in 'block'parts of backtraces.