summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_dir.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/ruby/test_dir.rb b/test/ruby/test_dir.rb
index 0cc5a6aa9b..88033158b7 100644
--- a/test/ruby/test_dir.rb
+++ b/test/ruby/test_dir.rb
@@ -331,4 +331,13 @@ class TestDir < Test::Unit::TestCase
end
}
end
+
+ def test_empty?
+ assert_not_send([Dir, :empty?, @root])
+ assert_send([Dir, :empty?, File.join(@root, "a")])
+ open(File.join(@root, "a", "..."), "w") {}
+ assert_not_send([Dir, :empty?, File.join(@root, "a")])
+ assert_raise(Errno::ENOENT) {Dir.empty?(@nodir)}
+ assert_not_send([Dir, :empty?, File.join(@root, "b")])
+ end
end