1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Guard out the test when it is run under root permission

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67247 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
mame 2019-03-14 01:04:53 +00:00
parent 0d6910dfc8
commit 6a860ea006

View file

@ -741,12 +741,14 @@ class TestFileUtils < Test::Unit::TestCase
assert_file_not_exist 'tmp/tmpdir/a'
assert_file_not_exist 'tmp/tmpdir/c'
File.chmod(01777, 'tmp/tmpdir')
if File.sticky?('tmp/tmpdir')
Dir.mkdir 'tmp/tmpdir/d', 0
assert_raise(Errno::EACCES) {remove_entry_secure 'tmp/tmpdir/d'}
File.chmod 0777, 'tmp/tmpdir/d'
Dir.rmdir 'tmp/tmpdir/d'
unless root_in_posix?
File.chmod(01777, 'tmp/tmpdir')
if File.sticky?('tmp/tmpdir')
Dir.mkdir 'tmp/tmpdir/d', 0
assert_raise(Errno::EACCES) {remove_entry_secure 'tmp/tmpdir/d'}
File.chmod 0777, 'tmp/tmpdir/d'
Dir.rmdir 'tmp/tmpdir/d'
end
end
Dir.rmdir 'tmp/tmpdir'