diff options
Diffstat (limited to 'test/fileutils/test_fileutils.rb')
-rw-r--r-- | test/fileutils/test_fileutils.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/fileutils/test_fileutils.rb b/test/fileutils/test_fileutils.rb index 923468d2b9..0c79bc4c1f 100644 --- a/test/fileutils/test_fileutils.rb +++ b/test/fileutils/test_fileutils.rb @@ -1612,6 +1612,15 @@ class TestFileUtils < Test::Unit::TestCase subdir = 'data/sub/dir' mkdir_p(subdir) + File.write("#{subdir}/file", '') + msg = "should fail to remove non-empty directory" + assert_raise(Errno::ENOTEMPTY, Errno::EEXIST, msg) { + rmdir(subdir) + } + assert_raise(Errno::ENOTEMPTY, Errno::EEXIST, msg) { + rmdir(subdir, parents: true) + } + File.unlink("#{subdir}/file") assert_nothing_raised(Errno::ENOENT) { rmdir(subdir, parents: true) } |