diff options
author | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-10-16 00:14:16 +0000 |
---|---|---|
committer | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-10-16 00:14:16 +0000 |
commit | 28918eac58eb6e2681d10839ac0d1430b2a4f1f9 (patch) | |
tree | 3c2c9e36118efe1d9406acdd14c186788879bea3 /test/rubygems/test_gem_package.rb | |
parent | cfe1458078b8cf36e490c516977c52e1faa9e88a (diff) | |
download | ruby-28918eac58eb6e2681d10839ac0d1430b2a4f1f9.tar.gz |
* lib/rubygems: Update to RubyGems master commit 2a74263. This fixes
several bugs in RubyGems 2.2.0.preview.1.
* test/rubygems: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43298 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/rubygems/test_gem_package.rb')
-rw-r--r-- | test/rubygems/test_gem_package.rb | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/test/rubygems/test_gem_package.rb b/test/rubygems/test_gem_package.rb index 79258ca3b4..6a328d5a53 100644 --- a/test/rubygems/test_gem_package.rb +++ b/test/rubygems/test_gem_package.rb @@ -427,6 +427,19 @@ class TestGemPackage < Gem::Package::TarTestCase assert_path_exists extracted end + def test_extract_tar_gz_dot_file + package = Gem::Package.new @gem + + tgz_io = util_tar_gz do |tar| + tar.add_file '.dot_file.rb', 0644 do |io| io.write 'hi' end + end + + package.extract_tar_gz tgz_io, @destination + + extracted = File.join @destination, '.dot_file.rb' + assert_path_exists extracted + end + def test_install_location package = Gem::Package.new @gem @@ -450,6 +463,22 @@ class TestGemPackage < Gem::Package::TarTestCase "#{@destination} is not allowed", e.message) end + def test_install_location_dots + package = Gem::Package.new @gem + + file = 'file.rb' + + destination = File.join @destination, 'foo', '..', 'bar' + + FileUtils.mkdir_p File.join @destination, 'foo' + FileUtils.mkdir_p File.expand_path destination + + destination = package.install_location file, destination + + # this test only fails on ruby missing File.realpath + assert_equal File.join(@destination, 'bar', 'file.rb'), destination + end + def test_install_location_extra_slash skip 'no File.realpath on 1.8' if RUBY_VERSION < '1.9' package = Gem::Package.new @gem |