aboutsummaryrefslogtreecommitdiffstats
path: root/lib/rubygems
diff options
context:
space:
mode:
authormame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-04-05 09:48:16 +0000
committermame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-04-05 09:48:16 +0000
commit4830a524b1a14d9ac342c60978b81c759375b3cb (patch)
tree471e0c91435ee99b9bb3e18ae83758df41af501e /lib/rubygems
parentdfd3467d3a4b9755ffd763e7d6c8d4982c1befee (diff)
downloadruby-4830a524b1a14d9ac342c60978b81c759375b3cb.tar.gz
lib/rubygems/test_case.rb: take over @gem_prelude_index
Gem::TestCase normalizes each path in $LOAD_PATH, which deleted the flag of @gem_prelude_index. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63100 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rubygems')
-rw-r--r--lib/rubygems/test_case.rb11
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/rubygems/test_case.rb b/lib/rubygems/test_case.rb
index bb6f4fde88..aa6df267f2 100644
--- a/lib/rubygems/test_case.rb
+++ b/lib/rubygems/test_case.rb
@@ -295,7 +295,16 @@ class Gem::TestCase < MiniTest::Unit::TestCase
@orig_LOAD_PATH = $LOAD_PATH.dup
$LOAD_PATH.map! { |s|
- (expand_path = File.expand_path(s)) == s ? s : expand_path.untaint
+ expand_path = File.expand_path(s)
+ if expand_path != s
+ expand_path.untaint
+ if s.instance_variable_defined?(:@gem_prelude_index)
+ expand_path.instance_variable_set(:@gem_prelude_index, expand_path)
+ end
+ expand_path.freeze if s.frozen?
+ s = expand_path
+ end
+ s
}
Dir.chdir @tempdir