summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authormame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-12-26 06:01:18 +0000
committermame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-12-26 06:01:18 +0000
commit925a722ae2c453c351d6e9fff9776bb0a2061642 (patch)
tree7f7f703cb09d9405e988f4b34daed65aa480c49b /test
parent1df30008b2461c930a3fb8a8d887f54e403f8379 (diff)
test/rdoc: skip some tests when euid is root
root user can access a file whose permission is 0000. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66569 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/rdoc/test_rdoc_options.rb1
-rw-r--r--test/rdoc/test_rdoc_rdoc.rb1
-rw-r--r--test/rdoc/test_rdoc_rubygems_hook.rb4
3 files changed, 6 insertions, 0 deletions
diff --git a/test/rdoc/test_rdoc_options.rb b/test/rdoc/test_rdoc_options.rb
index 394d155241..baef2d860e 100644
--- a/test/rdoc/test_rdoc_options.rb
+++ b/test/rdoc/test_rdoc_options.rb
@@ -18,6 +18,7 @@ class TestRDocOptions < RDoc::TestCase
def test_check_files
skip "assumes UNIX permission model" if /mswin|mingw/ =~ RUBY_PLATFORM
+ skip "assumes that euid is not root" if Process.euid == 0
out, err = capture_io do
temp_dir do
diff --git a/test/rdoc/test_rdoc_rdoc.rb b/test/rdoc/test_rdoc_rdoc.rb
index 4014ecfa54..3bce54b243 100644
--- a/test/rdoc/test_rdoc_rdoc.rb
+++ b/test/rdoc/test_rdoc_rdoc.rb
@@ -350,6 +350,7 @@ class TestRDocRDoc < RDoc::TestCase
def test_parse_file_forbidden
skip 'chmod not supported' if Gem.win_platform?
+ skip "assumes that euid is not root" if Process.euid == 0
@rdoc.store = RDoc::Store.new
diff --git a/test/rdoc/test_rdoc_rubygems_hook.rb b/test/rdoc/test_rdoc_rubygems_hook.rb
index 2fb79ff577..ff0c29ae1b 100644
--- a/test/rdoc/test_rdoc_rubygems_hook.rb
+++ b/test/rdoc/test_rdoc_rubygems_hook.rb
@@ -200,6 +200,8 @@ class TestRDocRubygemsHook < Gem::TestCase
def test_remove_unwritable
skip 'chmod not supported' if Gem.win_platform?
+ skip "assumes that euid is not root" if Process.euid == 0
+
FileUtils.mkdir_p @a.base_dir
FileUtils.chmod 0, @a.base_dir
@@ -228,6 +230,8 @@ class TestRDocRubygemsHook < Gem::TestCase
def test_setup_unwritable
skip 'chmod not supported' if Gem.win_platform?
+ skip "assumes that euid is not root" if Process.euid == 0
+
FileUtils.mkdir_p @a.doc_dir
FileUtils.chmod 0, @a.doc_dir