diff --git a/lib/rubygems/test_case.rb b/lib/rubygems/test_case.rb index 39aa4fc9a7..bb6f4fde88 100644 --- a/lib/rubygems/test_case.rb +++ b/lib/rubygems/test_case.rb @@ -756,6 +756,9 @@ class Gem::TestCase < MiniTest::Unit::TestCase 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