summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/rubygems/installer_test_case.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/rubygems/installer_test_case.rb b/lib/rubygems/installer_test_case.rb
index 5a3ce75c26..68200d7204 100644
--- a/lib/rubygems/installer_test_case.rb
+++ b/lib/rubygems/installer_test_case.rb
@@ -230,4 +230,21 @@ class Gem::InstallerTestCase < Gem::TestCase
:user_install => user)
end
+ @@symlink_supported = nil
+
+ # This is needed for Windows environment without symlink support enabled (the default
+ # for non admin) to be able to skip test for features using symlinks.
+ def symlink_supported?
+ if @@symlink_supported.nil?
+ begin
+ File.symlink("", "")
+ rescue Errno::ENOENT, Errno::EEXIST
+ @@symlink_supported = true
+ rescue NotImplementedError, SystemCallError
+ @@symlink_supported = false
+ end
+ end
+ @@symlink_supported
+ end
+
end