Repository navigation
Conversation
Ruby 3.4 and 4.0 have been released, but the CI matrix stopped at 3.3, so we had no continuous check that squasher works on the latest Rubies. actions/checkout@v3 is built on Node.js 16, a runtime GitHub Actions no longer supports, so bump it to v7, the current major version. Ruby 2.7 through 3.2 have reached EOL but are kept in the matrix. The gemspec does not declare required_ruby_version, and whether to narrow the supported versions is a separate decision. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
On JRuby, three of the Squasher.rake specs failed with "The message 'system' was received by ... but has already been received by Squasher". These specs stubbed system with expect_any_instance_of(Object). Since rspec-mocks 3.13.3, any_instance preserves the original method visibility, so on reset it calls `private :system` on Squasher's singleton class. On CRuby that only adds a visibility entry, and the method is looked up in the ancestors again on each call. JRuby instead copies the method body that is current at that moment. As a result, the Object#system that any_instance had installed in the previous example (the one that raises on a second call) stayed on Squasher, and the following examples failed. class Parent; def greet = :old; end class Child < Parent; private :greet; end class Parent; def greet = :new; end Child.new.send(:greet) # CRuby => :new / JRuby => :old This behavior is the same on JRuby 9.4 / 10.0 / 10.1. JRuby presumably passed on earlier CI runs because rspec-mocks was 3.13.2 or older. Squasher itself is the one calling system, so stubbing it directly on Squasher instead of on every Object instance is enough and avoids the problem above. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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
actions/checkoutfrom v3 to v7. v3 runs on Node.js 16, which GitHub Actions no longer supports.Squasher.rakespecs that fail on JRuby.Why the JRuby specs failed
Three
Squasher.rakespecs failed on JRuby with:The specs stubbed
systemwithexpect_any_instance_of(Object). Since rspec-mocks 3.13.3,any_instancepreserves the original visibility of the method, so on reset rspec-mocks callsprivate :systemon Squasher's singleton class. CRuby and JRuby treat that call differently when the method is inherited:On JRuby,
privatecopies the method body that is current at that moment. Here that body is theObject#systemthatany_instanceinstalled in the previous example, which raises on a second call. That body stays on Squasher, so the next example fails. This behavior is the same on JRuby 9.4, 10.0 and 10.1. JRuby presumably passed on earlier CI runs because rspec-mocks was 3.13.2 or older.Squasher itself calls
system, so the specs now stub it directly onSquasherinstead of on everyObjectinstance.🤖 Generated with Claude Code