File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -994,6 +994,11 @@ class ContextModeTest < TestIRB::IntegrationTestCase
994994 def test_context_mode_ruby_box
995995 omit if RUBY_VERSION < "4.0.0"
996996 @envs [ 'RUBY_BOX' ] = '1'
997+ # Ruby::Box now initializes RubyGems per box upstream. Avoid loading bundler context into test execution context.
998+ %w[ BUNDLER_SETUP BUNDLER_VERSION BUNDLE_BIN_PATH BUNDLE_GEMFILE RUBYOPT ] . each do |env |
999+ @envs [ env ] = nil
1000+ end
1001+ @envs [ 'RUBYLIB' ] = Gem . loaded_specs . fetch ( 'reline' ) . full_require_paths . join ( File ::PATH_SEPARATOR )
9971002
9981003 write_rc <<~'RUBY'
9991004 IRB.conf[:CONTEXT_MODE] = 5
@@ -1007,11 +1012,13 @@ def test_context_mode_ruby_box
10071012 RUBY
10081013
10091014 output = run_ruby_file ( timeout : TIMEOUT_SEC ) do
1015+ type 'p gem_specification: defined?(Gem::Specification)'
10101016 type 'class Integer; def +(_other) = 42; end'
10111017 type 'p answer1: 1 + 2'
10121018 type 'exit'
10131019 end
10141020
1021+ assert_include ( output , '{gem_specification: "constant"}' )
10151022 assert_include ( output , '{answer1: 42}' )
10161023 assert_include ( output , '{answer2: 3}' )
10171024 end
You can’t perform that action at this time.
0 commit comments