mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
test_case.rb: fix multiple load
* lib/rubygems/test_case.rb (teardown): do not delete features loaded from the original load paths, the same libraries should be loaded again when the same features are required. [ruby-dev:49031] [Bug #11222] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51138 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
443ce92b3d
commit
5c19a5fa24
2 changed files with 19 additions and 1 deletions
|
@ -1,3 +1,10 @@
|
|||
Sat Jul 4 10:42:57 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* lib/rubygems/test_case.rb (teardown): do not delete features
|
||||
loaded from the original load paths, the same libraries should
|
||||
be loaded again when the same features are required.
|
||||
[ruby-dev:49031] [Bug #11222]
|
||||
|
||||
Sat Jul 4 09:38:52 2015 Eric Wong <e@80x24.org>
|
||||
|
||||
* vm.c (rb_vm_mark): reduce branches for always-set VM fields
|
||||
|
|
|
@ -342,7 +342,18 @@ class Gem::TestCase < MiniTest::Unit::TestCase
|
|||
|
||||
def teardown
|
||||
$LOAD_PATH.replace @orig_LOAD_PATH if @orig_LOAD_PATH
|
||||
$LOADED_FEATURES.replace @orig_LOADED_FEATURES if @orig_LOADED_FEATURES
|
||||
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
|
||||
end
|
||||
else
|
||||
$LOADED_FEATURES.replace @orig_LOADED_FEATURES
|
||||
end
|
||||
end
|
||||
|
||||
if @orig_BASERUBY
|
||||
RbConfig::CONFIG['BASERUBY'] = @orig_BASERUBY
|
||||
|
|
Loading…
Reference in a new issue