aboutsummaryrefslogtreecommitdiffstats
path: root/test/rubygems/test_gem_package.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/rubygems/test_gem_package.rb')
-rw-r--r--test/rubygems/test_gem_package.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/rubygems/test_gem_package.rb b/test/rubygems/test_gem_package.rb
index 1e9603c6c7..87e7274051 100644
--- a/test/rubygems/test_gem_package.rb
+++ b/test/rubygems/test_gem_package.rb
@@ -18,6 +18,8 @@ class TestGemPackage < Gem::Package::TarTestCase
@gem = @spec.cache_file
@destination = File.join @tempdir, 'extract'
+
+ FileUtils.mkdir_p @destination
end
def test_class_new_old_format
@@ -330,6 +332,20 @@ class TestGemPackage < Gem::Package::TarTestCase
"#{@destination} is not allowed", e.message)
end
+ def test_install_location_extra_slash
+ package = Gem::Package.new @gem
+
+ file = 'foo//file.rb'
+ file.taint
+
+ destination = @destination.sub '/', '//'
+
+ destination = package.install_location file, destination
+
+ assert_equal File.join(@destination, 'foo', 'file.rb'), destination
+ refute destination.tainted?
+ end
+
def test_install_location_relative
package = Gem::Package.new @gem