mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
test_dir.rb: Dir.empty? with directories
* test/ruby/test_dir.rb (test_empty): check with directories. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53862 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
be9699a250
commit
e4809b056c
1 changed files with 4 additions and 0 deletions
|
@ -342,6 +342,10 @@ class TestDir < Test::Unit::TestCase
|
||||||
assert_not_send([Dir, :empty?, a])
|
assert_not_send([Dir, :empty?, a])
|
||||||
File.delete(tmp)
|
File.delete(tmp)
|
||||||
assert_send([Dir, :empty?, a])
|
assert_send([Dir, :empty?, a])
|
||||||
|
Dir.mkdir(tmp)
|
||||||
|
assert_not_send([Dir, :empty?, a])
|
||||||
|
Dir.rmdir(tmp)
|
||||||
|
assert_send([Dir, :empty?, a])
|
||||||
end
|
end
|
||||||
assert_raise(Errno::ENOENT) {Dir.empty?(@nodir)}
|
assert_raise(Errno::ENOENT) {Dir.empty?(@nodir)}
|
||||||
assert_not_send([Dir, :empty?, File.join(@root, "b")])
|
assert_not_send([Dir, :empty?, File.join(@root, "b")])
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue