Skip to content

Require the test helper directly instead of injecting it via ruby_opts - #56

Merged
kou merged 1 commit into
masterfrom
claude/bundler-setup-gem-prelude-1115a9
Aug 20, 2026
Merged

Require the test helper directly instead of injecting it via ruby_opts#56
kou merged 1 commit into
masterfrom
claude/bundler-setup-gem-prelude-1115a9

Conversation

@hsbt

@hsbt hsbt commented Aug 20, 2026

Copy link
Copy Markdown
Member

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's gem_prelude.rb no longer requires bundler/setup implicitly, so the helper injected through t.ruby_opts << "-rhelper" runs before Bundler activates the git-sourced test-unit-ruby-core gem.

This drops the ruby_opts injection and requires the helper from the test files with require_relative, deferring it until after bundler/setup has run.

Fixes #55

Generated with Claude Code

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>
Copilot AI lite review requested due to automatic review settings August 20, 2026 05:08
@hsbt
hsbt deployed to release August 20, 2026 05:08 — with GitHub Actions Active

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 extra test/lib load path) from the Rakefile test task.
  • Require the shared test helper directly from affected test entrypoints via require_relative.
  • Ensure the helper (which pulls in test/unit and core_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.

@kou
kou merged commit a3d1558 into master Aug 20, 2026
31 checks passed
@kou
kou deleted the claude/bundler-setup-gem-prelude-1115a9 branch August 20, 2026 05:16
@hsbt

hsbt commented Aug 20, 2026

Copy link
Copy Markdown
Member Author

As a side note, test/lib/helper.rb lives outside test/drb because that layout was needed to sync with ruby/ruby. That reason is gone now, so it might be better to move the helper into the same directory as the tests.

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.

CI: core_assertions LoadError in Windows cases

3 participants