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:
parent
0d6910dfc8
commit
6a860ea006
@ -741,12 +741,14 @@ class TestFileUtils < Test::Unit::TestCase
|
|||||||
assert_file_not_exist 'tmp/tmpdir/a'
|
assert_file_not_exist 'tmp/tmpdir/a'
|
||||||
assert_file_not_exist 'tmp/tmpdir/c'
|
assert_file_not_exist 'tmp/tmpdir/c'
|
||||||
|
|
||||||
File.chmod(01777, 'tmp/tmpdir')
|
unless root_in_posix?
|
||||||
if File.sticky?('tmp/tmpdir')
|
File.chmod(01777, 'tmp/tmpdir')
|
||||||
Dir.mkdir 'tmp/tmpdir/d', 0
|
if File.sticky?('tmp/tmpdir')
|
||||||
assert_raise(Errno::EACCES) {remove_entry_secure 'tmp/tmpdir/d'}
|
Dir.mkdir 'tmp/tmpdir/d', 0
|
||||||
File.chmod 0777, 'tmp/tmpdir/d'
|
assert_raise(Errno::EACCES) {remove_entry_secure 'tmp/tmpdir/d'}
|
||||||
Dir.rmdir 'tmp/tmpdir/d'
|
File.chmod 0777, 'tmp/tmpdir/d'
|
||||||
|
Dir.rmdir 'tmp/tmpdir/d'
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
Dir.rmdir 'tmp/tmpdir'
|
Dir.rmdir 'tmp/tmpdir'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user