aboutsummaryrefslogtreecommitdiffstats
path: root/test/fileutils
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-02-17 10:22:10 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-02-17 10:22:10 +0000
commite74e31560b6588b62884b05d537080b19e5d3ea3 (patch)
tree5753afcc8feecb6da63b8317cca42a5b32cccee3 /test/fileutils
parent2b1fcfb9d3b31d9228f21763740fba06cee1ce23 (diff)
downloadruby-e74e31560b6588b62884b05d537080b19e5d3ea3.tar.gz
test_fileutils.rb: workaround for Cygwin
* test/fileutils/test_fileutils.rb (root_in_posix): seems Cygwin has some different conditions for privilege. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57646 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/fileutils')
-rw-r--r--test/fileutils/test_fileutils.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/test/fileutils/test_fileutils.rb b/test/fileutils/test_fileutils.rb
index 35b3f52cfa..19359e4bdd 100644
--- a/test/fileutils/test_fileutils.rb
+++ b/test/fileutils/test_fileutils.rb
@@ -75,6 +75,10 @@ class TestFileUtils < Test::Unit::TestCase
end
def root_in_posix?
+ if /cygwin/ =~ RUBY_PLATFORM
+ # FIXME: privilege if groups include root user?
+ return Process.groups.include?(0)
+ end
if Process.respond_to?('uid')
return Process.uid == 0
else