Require the test helper directly instead of injecting it via ruby_opts - #56
Merged
Merged
Conversation
ruby/ruby's gem_prelude.rb no longer requires bundler/setup implicitly, so a helper loaded through `-rhelper` runs before Bundler activates git-sourced gems and fails with `cannot load such file -- core_assertions`. Requiring the helper from the test files defers it until after bundler/setup has run. Fixes #55 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Updates the test harness to avoid relying on Rake::TestTask RUBYOPT injection for loading the test helper, addressing Windows CI failures where core_assertions cannot be loaded before Bundler has activated git-sourced gems.
Changes:
- Remove
t.ruby_opts << "-rhelper"(and the extratest/libload path) from theRakefiletest task. - Require the shared test helper directly from affected test entrypoints via
require_relative. - Ensure the helper (which pulls in
test/unitandcore_assertions) is loaded after Bundler setup in the test process.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
test/drb/test_drbobject.rb |
Requires the shared test helper via require_relative instead of directly requiring test/unit. |
test/drb/test_acl.rb |
Requires the shared test helper via require_relative to defer helper loading until after Bundler is active. |
test/drb/drbtest.rb |
Requires the shared test helper so all tests that depend on drbtest inherit the correct setup. |
Rakefile |
Drops test helper loading via ruby_opts injection (and the extra test/lib load path). |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Member
Author
|
As a side note, |
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.
CI on Windows head and mswin fails with
cannot load such file -- core_assertions(#55, ruby/rubygems#9782). The root cause is that ruby/ruby'sgem_prelude.rbno longer requiresbundler/setupimplicitly, so the helper injected throught.ruby_opts << "-rhelper"runs before Bundler activates the git-sourcedtest-unit-ruby-coregem.This drops the
ruby_optsinjection and requires the helper from the test files withrequire_relative, deferring it until afterbundler/setuphas run.Fixes #55
Generated with Claude Code