ruby-changes:54355
From: mame <ko1@a...>
Date: Wed, 26 Dec 2018 15:01:22 +0900 (JST)
Subject: [ruby-changes:54355] mame:r66569 (trunk): test/rdoc: skip some tests when euid is root
mame 2018-12-26 15:01:18 +0900 (Wed, 26 Dec 2018) New Revision: 66569 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=66569 Log: test/rdoc: skip some tests when euid is root root user can access a file whose permission is 0000. Modified files: trunk/test/rdoc/test_rdoc_options.rb trunk/test/rdoc/test_rdoc_rdoc.rb trunk/test/rdoc/test_rdoc_rubygems_hook.rb Index: test/rdoc/test_rdoc_rubygems_hook.rb =================================================================== --- test/rdoc/test_rdoc_rubygems_hook.rb (revision 66568) +++ test/rdoc/test_rdoc_rubygems_hook.rb (revision 66569) @@ -200,6 +200,8 @@ class TestRDocRubygemsHook < Gem::TestCa https://github.com/ruby/ruby/blob/trunk/test/rdoc/test_rdoc_rubygems_hook.rb#L200 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::TestCa https://github.com/ruby/ruby/blob/trunk/test/rdoc/test_rdoc_rubygems_hook.rb#L230 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 Index: test/rdoc/test_rdoc_rdoc.rb =================================================================== --- test/rdoc/test_rdoc_rdoc.rb (revision 66568) +++ test/rdoc/test_rdoc_rdoc.rb (revision 66569) @@ -350,6 +350,7 @@ class TestRDocRDoc < RDoc::TestCase https://github.com/ruby/ruby/blob/trunk/test/rdoc/test_rdoc_rdoc.rb#L350 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 Index: test/rdoc/test_rdoc_options.rb =================================================================== --- test/rdoc/test_rdoc_options.rb (revision 66568) +++ test/rdoc/test_rdoc_options.rb (revision 66569) @@ -18,6 +18,7 @@ class TestRDocOptions < RDoc::TestCase https://github.com/ruby/ruby/blob/trunk/test/rdoc/test_rdoc_options.rb#L18 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 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/