* backport r33074 from trunk

* lib/rubygems:  Update to RubyGems 1.8.10.  Fixes security issue in
  creating ruby-format gemspecs.  Fixes Gem.dir not being at the front
  of Gem.path to fix uninstall and cleanup commands.  Fixes gem
  uninstall stopping on the first missing gem.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@33075 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
drbrain 2011-08-26 01:12:57 +00:00
parent 322937ff00
commit f5c8aecebc
12 changed files with 208 additions and 76 deletions

View file

@ -22,10 +22,10 @@ class TestGemPathSupport < Gem::TestCase
def test_initialize_home
ps = Gem::PathSupport.new "GEM_HOME" => "#{@tempdir}/foo"
assert_equal File.join(@tempdir, "foo"), ps.home
expected = File.join(@tempdir, "foo")
assert_equal expected, ps.home
expected = util_path + [File.join(@tempdir, 'foo')]
assert_equal expected, ps.path
assert_equal [expected, *util_path], ps.path
end
if defined?(File::ALT_SEPARATOR) and File::ALT_SEPARATOR
@ -43,9 +43,9 @@ class TestGemPathSupport < Gem::TestCase
assert_equal ENV["GEM_HOME"], ps.home
expected = [
ENV["GEM_HOME"],
File.join(@tempdir, 'foo'),
File.join(@tempdir, 'bar'),
ENV["GEM_HOME"],
]
assert_equal expected, ps.path
@ -61,6 +61,32 @@ class TestGemPathSupport < Gem::TestCase
assert_equal expected, ps.path
end
def test_path_equals
ps = Gem::PathSupport.new
ps.send :path=, ['a', 'b']
assert_equal [@tempdir, 'a', 'b'], ps.path
end
def test_path_equals_empty
ps = Gem::PathSupport.new
ps.send :path=, nil
assert_equal [@tempdir, 'something'], ps.path
end
def test_path_equals_empty_no_GEM_PATH
ENV.delete 'GEM_PATH'
ps = Gem::PathSupport.new
ps.send :path=, nil
assert_equal [@tempdir, *Gem.default_path], ps.path
end
def util_path
ENV["GEM_PATH"].split(File::PATH_SEPARATOR)
end