diff options
author | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-01-17 00:37:28 +0000 |
---|---|---|
committer | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-01-17 00:37:28 +0000 |
commit | 219e1566876c2a6996b88728eb558691d5c77459 (patch) | |
tree | 4730b8dc51bd5d10d92b49a081bef77b1c0956e2 /test | |
parent | 1be8ac57abca95de2525c9b56fb51e9c8a802660 (diff) | |
download | ruby-219e1566876c2a6996b88728eb558691d5c77459.tar.gz |
* lib/rubygems/installer.rb: Untaint string when checking output
for $SAFE=1
* lib/rubygems/specification.rb: Keep previously loaded specs as
active. This prevents double loading when refreshing the gem list.
* test/rubygems/test_gem.rb: Test for above
* lib/rubygems.rb: Bump version to 2.0.0.rc.2
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38855 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/rubygems/test_gem.rb | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/test/rubygems/test_gem.rb b/test/rubygems/test_gem.rb index 9efb056546..8fbae7f669 100644 --- a/test/rubygems/test_gem.rb +++ b/test/rubygems/test_gem.rb @@ -959,6 +959,27 @@ class TestGem < Gem::TestCase assert_includes Gem::Specification.all_names, @a1.full_name end + def test_self_refresh_keeps_loaded_specs_activated + util_make_gems + + a1_spec = @a1.spec_file + moved_path = File.join @tempdir, File.basename(a1_spec) + + FileUtils.mv a1_spec, moved_path + + Gem.refresh + + s = Gem::Specification.first + s.activate + + Gem.refresh + + Gem::Specification.each{|spec| assert spec.activated? if spec == s} + + Gem.loaded_specs.delete(s) + Gem.refresh + end + def test_self_ruby_escaping_spaces_in_path orig_ruby = Gem.ruby orig_bindir = Gem::ConfigMap[:bindir] |