Skip to content

Commit 814880d

Browse files
mameaycabta
authored andcommitted
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
1 parent ba8f9bf commit 814880d

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

test/test_rdoc_options.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ def teardown
1818

1919
def test_check_files
2020
skip "assumes UNIX permission model" if /mswin|mingw/ =~ RUBY_PLATFORM
21+
skip "assumes that euid is not root" if Process.euid == 0
2122

2223
out, err = capture_io do
2324
temp_dir do

test/test_rdoc_rdoc.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -350,6 +350,7 @@ def test_parse_file_encoding
350350

351351
def test_parse_file_forbidden
352352
skip 'chmod not supported' if Gem.win_platform?
353+
skip "assumes that euid is not root" if Process.euid == 0
353354

354355
@rdoc.store = RDoc::Store.new
355356

test/test_rdoc_rubygems_hook.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,8 @@ def test_remove
200200

201201
def test_remove_unwritable
202202
skip 'chmod not supported' if Gem.win_platform?
203+
skip "assumes that euid is not root" if Process.euid == 0
204+
203205
FileUtils.mkdir_p @a.base_dir
204206
FileUtils.chmod 0, @a.base_dir
205207

@@ -228,6 +230,8 @@ def test_setup
228230

229231
def test_setup_unwritable
230232
skip 'chmod not supported' if Gem.win_platform?
233+
skip "assumes that euid is not root" if Process.euid == 0
234+
231235
FileUtils.mkdir_p @a.doc_dir
232236
FileUtils.chmod 0, @a.doc_dir
233237

0 commit comments

Comments
 (0)