summaryrefslogtreecommitdiff
path: root/test/rubygems/test_gem_path_support.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/rubygems/test_gem_path_support.rb')
-rw-r--r--test/rubygems/test_gem_path_support.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/rubygems/test_gem_path_support.rb b/test/rubygems/test_gem_path_support.rb
index ccb46d6b8e..90d50a269f 100644
--- a/test/rubygems/test_gem_path_support.rb
+++ b/test/rubygems/test_gem_path_support.rb
@@ -118,4 +118,21 @@ class TestGemPathSupport < Gem::TestCase
ps = Gem::PathSupport.new "GEM_SPEC_CACHE" => "foo"
assert_equal "foo", ps.spec_cache_dir
end
+
+ def test_gem_paths_do_not_contain_symlinks
+ dir = "#{@tempdir}/realgemdir"
+ symlink = "#{@tempdir}/symdir"
+ Dir.mkdir dir
+ begin
+ File.symlink(dir, symlink)
+ rescue NotImplementedError, SystemCallError
+ skip 'symlinks not supported'
+ end
+ not_existing = "#{@tempdir}/does_not_exist"
+ path = "#{symlink}#{File::PATH_SEPARATOR}#{not_existing}"
+
+ ps = Gem::PathSupport.new "GEM_PATH" => path, "GEM_HOME" => symlink
+ assert_equal dir, ps.home
+ assert_equal [dir, not_existing], ps.path
+ end
end