diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2019-01-31 14:02:30 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2019-01-31 14:02:30 +0000 |
commit | cb5a32981404e1bd691978ad9e7ce6a824315995 (patch) | |
tree | 5a431264a13280f0ac78b56d2278f8bcc1281604 /test | |
parent | 1f64192494e896277a8c72a9d0d53ebc93abe312 (diff) | |
download | ruby-cb5a32981404e1bd691978ad9e7ce6a824315995.tar.gz |
Fix exception namespace
* lib/fileutils.rb (remove_entry_secure): EISDIR is under the
Errno namespace. [ruby-core:91362] [Bug #15577]
From: Tietew (Toru Iwase) <tietew@tietew.net>
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66972 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/fileutils/test_fileutils.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/fileutils/test_fileutils.rb b/test/fileutils/test_fileutils.rb index f2600005f5..64dd2464c0 100644 --- a/test/fileutils/test_fileutils.rb +++ b/test/fileutils/test_fileutils.rb @@ -740,7 +740,15 @@ class TestFileUtils < Test::Unit::TestCase remove_entry_secure 'tmp/tmpdir/c', true assert_file_not_exist 'tmp/tmpdir/a' 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' + Dir.rmdir 'tmp/tmpdir' + end def test_remove_entry_secure_symlink |