Conversation
Gem::Server itself never references the Zlib module; gzip helpers used here go through Gem::Util.gzip / .gunzip, which require zlib lazily on their own. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The helper was forked wholesale from ruby/rubygems and carried ~1500 lines of fixtures, FakeFetcher plumbing, MockGemUi wiring, and platform helpers that none of the Gem::Server tests touch. Several of those requires (benchmark, rubygems/mock_gem_ui) also fail on modern Ruby where they are no longer default. Strip the helper down to just what the two server test files actually use, and drop utilities.rb entirely. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Streamlines the RubyGems test harness by removing a large, shared test utility module and trimming Gem::TestCase down to a smaller helper set, while also dropping an unused stdlib require and updating CI Ruby versions.
Changes:
- Removed
test/rubygems/utilities.rband the relatedrequire_relativeusage from the test helper. - Significantly reduced
test/rubygems/helper.rb, keeping only a subset of helper APIs and simplifyingquick_gemspec-file writing. - Updated CI Ruby matrix and removed
require 'zlib'fromlib/rubygems/server.rb.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
test/rubygems/utilities.rb |
Deleted the shared fake fetcher/spec fetcher/temp IO helpers previously used by tests. |
test/rubygems/helper.rb |
Trimmed the test helper substantially; retained only a minimal set of helpers and simplified spec file writing. |
lib/rubygems/server.rb |
Removed an unused zlib require at the file header. |
.github/workflows/test.yml |
Updated the Ruby version matrix to newer versions and removed older/nightly entries. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
79
to
84
| Gem.loaded_specs.clear | ||
| Gem.instance_variable_set(:@activated_gem_paths, 0) | ||
| Gem.clear_default_specs | ||
| Bundler.reset! | ||
|
|
||
| Gem.configuration.verbose = true | ||
| Gem.configuration.update_sources = true |
Without Bundler.reset!, Gem::Specification still surfaces the gems Bundler activated for `bundle exec rake test` (bundler, rake, test-unit, webrick, ...) even after Gem.use_paths(@gemhome), which makes the gem listing tests fail by including those gems in the rendered HTML. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
RDoc 4.0 shipped in 2013 and the gem's required_ruby_version is now 3.1, so the older "/doc_root/<gem>/rdoc/index.html" path can never be reached. The version probe also breaks on rdoc 7.x: Gem::RDoc is aliased to RDoc::RubygemsHook (a delegating shim to RubyGemsHook) and the tests' direct @rdoc_version override on the shim has no effect, so test_doc_root_3 / test_have_rdoc_4_plus_eh fail on Ruby 3.1 once rdoc 7.x is in the bundle. Always emit the 4.0+ URL, drop have_rdoc_4_plus?, and remove the version-probe tests. Co-Authored-By: Claude Opus 4.7 (1M context) <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.
No description provided.