[rubygems/rubygems] Keep loaded features
Now `$LOADED_FEATURES` list is being maintained by `setup` and `teardown` and, only libaries under the temporary directory will be removed. As `save_loaded_features` removes the rest libraries other than this test directory, ordinary libraries loaded from files under rubygems also removed, and often causes constant redefinition warnings. https://github.com/rubygems/rubygems/commit/9e1f92aafd
This commit is contained in:
parent
1aa9fcca76
commit
3f0150f2fd
@ -826,13 +826,7 @@ class Gem::TestCase < Test::Unit::TestCase
|
||||
end
|
||||
|
||||
def save_loaded_features
|
||||
old_loaded_features = $LOADED_FEATURES.dup
|
||||
yield
|
||||
ensure
|
||||
prefix = File.dirname(__FILE__) + "/"
|
||||
new_features = ($LOADED_FEATURES - old_loaded_features)
|
||||
old_loaded_features.concat(new_features.select {|f| f.rindex(prefix, 0) })
|
||||
$LOADED_FEATURES.replace old_loaded_features
|
||||
end
|
||||
|
||||
def new_default_spec(name, version, deps = nil, *files)
|
||||
|
Loading…
x
Reference in New Issue
Block a user