Skip to content

Commit e794ab7

Browse files
hsbtclaude
andcommitted
Load RDoc before the test sandbox in TestGemRDoc
RDoc 8 depends on rbs, and that dependency stays unresolved when several rbs versions are installed. It is then resolved on the first require of rbs, which happens inside Gem::RDoc#setup, after Gem::TestCase#setup has pointed GEM_HOME at an empty temporary directory, so it raises LoadError. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
1 parent e5f0607 commit e794ab7

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

test/rubygems/test_gem_rdoc.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@
44
require_relative "helper"
55
require "rubygems/rdoc"
66

7+
# RDoc resolves its own dependencies lazily, on require. Load them here, while
8+
# the real gem paths are still in effect, because Gem::TestCase#setup points
9+
# GEM_HOME at an empty temporary directory where they cannot be found.
10+
Gem::RDoc.load_rdoc if defined?(Gem::RDoc)
11+
712
class TestGemRDoc < Gem::TestCase
813
def setup
914
super

0 commit comments

Comments
 (0)