mirror of
https://github.com/ruby/ruby.git
synced 2025-09-17 09:33:59 +02:00
Make sure to only reset "dummy" $LOADED_FEATURES
Namely, those generated under `/tmp`. The previous approach was brittle and broken in the case of ruby-core, because under that setup, the current folder is in the original `$LOAD_PATH`, and dummy features are created under `./tmp`, so they were failing to be reset.
This commit is contained in:
parent
f5459acd79
commit
106d616cc8
Notes:
git
2020-06-17 21:17:30 +09:00
1 changed files with 1 additions and 4 deletions
|
@ -429,11 +429,8 @@ class Gem::TestCase < Minitest::Test
|
|||
$LOAD_PATH.replace @orig_LOAD_PATH if @orig_LOAD_PATH
|
||||
if @orig_LOADED_FEATURES
|
||||
if @orig_LOAD_PATH
|
||||
paths = @orig_LOAD_PATH.map {|path| File.join(File.expand_path(path), "/") }
|
||||
($LOADED_FEATURES - @orig_LOADED_FEATURES).each do |feat|
|
||||
unless paths.any? {|path| feat.start_with?(path) }
|
||||
$LOADED_FEATURES.delete(feat)
|
||||
end
|
||||
$LOADED_FEATURES.delete(feat) if feat.start_with?(@tmp)
|
||||
end
|
||||
else
|
||||
$LOADED_FEATURES.replace @orig_LOADED_FEATURES
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue