Skip to content

Commit d841e82

Browse files
committed
Update Ruby::Box context-mode test
1 parent bf32202 commit d841e82

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

test/irb/test_irb.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -994,6 +994,10 @@ 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
9971001

9981002
write_rc <<~'RUBY'
9991003
IRB.conf[:CONTEXT_MODE] = 5
@@ -1007,11 +1011,13 @@ def test_context_mode_ruby_box
10071011
RUBY
10081012

10091013
output = run_ruby_file(timeout: TIMEOUT_SEC) do
1014+
type 'p gem_specification: defined?(Gem::Specification)'
10101015
type 'class Integer; def +(_other) = 42; end'
10111016
type 'p answer1: 1 + 2'
10121017
type 'exit'
10131018
end
10141019

1020+
assert_include(output, '{gem_specification: "constant"}')
10151021
assert_include(output, '{answer1: 42}')
10161022
assert_include(output, '{answer2: 3}')
10171023
end

0 commit comments

Comments
 (0)