diff options
Diffstat (limited to 'test/pathname/test_pathname.rb')
-rw-r--r-- | test/pathname/test_pathname.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/pathname/test_pathname.rb b/test/pathname/test_pathname.rb index 2690a3f6de..848d4e4190 100644 --- a/test/pathname/test_pathname.rb +++ b/test/pathname/test_pathname.rb @@ -1212,6 +1212,20 @@ class TestPathname < Test::Unit::TestCase } end + def test_empty? + with_tmpchdir('rubytest-pathname') {|dir| + open("nonemptyfile", "w") {|f| f.write "abc" } + open("emptyfile", "w") {|f| } + Dir.mkdir("nonemptydir") + open("nonemptydir/somefile", "w") {|f| } + Dir.mkdir("emptydir") + assert_equal(true, Pathname("emptyfile").empty?) + assert_equal(false, Pathname("nonemptyfile").empty?) + assert_equal(true, Pathname("emptydir").empty?) + assert_equal(false, Pathname("nonemptydir").empty?) + } + end + def test_s_glob with_tmpchdir('rubytest-pathname') {|dir| open("f", "w") {|f| f.write "abc" } |