зеркало из https://github.com/github/ruby.git
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:
Родитель
0d6910dfc8
Коммит
6a860ea006
|
@ -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'
|
||||
|
|
Загрузка…
Ссылка в новой задаче