Skip to content

Commit

Permalink
test/rdoc: skip some tests when euid is root
Browse files Browse the repository at this point in the history
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
  • Loading branch information
mame authored and aycabta committed Dec 26, 2018
1 parent ba8f9bf commit 814880d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions test/test_rdoc_options.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ def teardown

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
Expand Down
1 change: 1 addition & 0 deletions test/test_rdoc_rdoc.rb
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,7 @@ def test_parse_file_encoding

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

Expand Down
4 changes: 4 additions & 0 deletions test/test_rdoc_rubygems_hook.rb
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,8 @@ def test_remove

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

Expand Down Expand Up @@ -228,6 +230,8 @@ def test_setup

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

Expand Down

0 comments on commit 814880d

Please sign in to comment.