aboutsummaryrefslogtreecommitdiffstats
path: root/test/fileutils
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2019-02-01 01:31:34 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2019-02-01 01:31:34 +0000
commitaf83a85f75389f646b753807c1136a7e591dec6a (patch)
tree01a74110345e5bcc8a332babb1cc1a7a0aade67c /test/fileutils
parentcb5a32981404e1bd691978ad9e7ce6a824315995 (diff)
downloadruby-af83a85f75389f646b753807c1136a7e591dec6a.tar.gz
Run r66972 assertion only when a sticky-bit makes sense
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66973 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/fileutils')
-rw-r--r--test/fileutils/test_fileutils.rb11
1 files changed, 6 insertions, 5 deletions
diff --git a/test/fileutils/test_fileutils.rb b/test/fileutils/test_fileutils.rb
index 64dd2464c0..f74ae5a755 100644
--- a/test/fileutils/test_fileutils.rb
+++ b/test/fileutils/test_fileutils.rb
@@ -742,13 +742,14 @@ class TestFileUtils < Test::Unit::TestCase
assert_file_not_exist 'tmp/tmpdir/c'
File.chmod(01777, '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'
+ 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
Dir.rmdir 'tmp/tmpdir'
-
end
def test_remove_entry_secure_symlink