summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2020-02-17 14:02:17 +0100
committergit <svn-admin@ruby-lang.org>2021-12-06 05:25:22 +0900
commite713552868c05fe77a2e3acb825460e5c2bdb53f (patch)
tree8c5662d7ee4a06d89b2e0005b040a0ad90c39895
parent2fc47bad78a26e5f53e0281f328afcc0518c4d41 (diff)
[rubygems/rubygems] LOAD_PATH is already reset globally
https://github.com/rubygems/rubygems/commit/b0bbb27115
-rw-r--r--test/rubygems/test_require.rb20
1 files changed, 4 insertions, 16 deletions
diff --git a/test/rubygems/test_require.rb b/test/rubygems/test_require.rb
index 02fbd5e7b1..56774116a9 100644
--- a/test/rubygems/test_require.rb
+++ b/test/rubygems/test_require.rb
@@ -78,8 +78,6 @@ class TestGemRequire < Gem::TestCase
FileUtils.mkdir_p File.dirname c_rb
File.open(c_rb, 'w') {|f| f.write "class Object; HELLO = 'world' end" }
- lp = $LOAD_PATH.dup
-
# Pretend to provide a commandline argument that overrides a file in gem b
$LOAD_PATH.unshift dash_i_arg
@@ -88,7 +86,6 @@ class TestGemRequire < Gem::TestCase
assert_equal "world", ::Object::HELLO
assert_equal %w[a-1 b-1], loaded_spec_names
ensure
- $LOAD_PATH.replace lp
Object.send :remove_const, :HELLO if Object.const_defined? :HELLO
end
@@ -122,8 +119,6 @@ class TestGemRequire < Gem::TestCase
assert_require 'test_gem_require_a'
- lp = $LOAD_PATH.dup
-
# Pretend to provide a commandline argument that overrides a file in gem b
$LOAD_PATH.unshift dash_i_arg
@@ -132,7 +127,6 @@ class TestGemRequire < Gem::TestCase
assert_equal "world", ::Object::HELLO
assert_equal %w[a-1 b-1], loaded_spec_names
ensure
- $LOAD_PATH.replace lp
Object.send :remove_const, :HELLO if Object.const_defined? :HELLO
end
@@ -143,16 +137,10 @@ class TestGemRequire < Gem::TestCase
dash_i_ext_arg = util_install_extension_file('a')
dash_i_lib_arg = util_install_ruby_file('a')
- lp = $LOAD_PATH.dup
-
- begin
- $LOAD_PATH.unshift dash_i_lib_arg
- $LOAD_PATH.unshift dash_i_ext_arg
- assert_require 'a'
- assert_match(/a\.rb$/, $LOADED_FEATURES.last)
- ensure
- $LOAD_PATH.replace lp
- end
+ $LOAD_PATH.unshift dash_i_lib_arg
+ $LOAD_PATH.unshift dash_i_ext_arg
+ assert_require 'a'
+ assert_match(/a\.rb$/, $LOADED_FEATURES.last)
end
def test_concurrent_require