summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-04-13 05:47:49 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-04-13 05:47:49 +0000
commit096137e84fcb3a01089785bb2b8b621f3f7e996f (patch)
tree7c787eebc746b7856989278608310ba02f2c8229 /test
parent134d1ce89255f94c42730c814dbf3efed1c557d2 (diff)
file.c: File.empty?
* file.c (Init_File): add alias File.empty? to File.zero?. [Feature #9969] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54559 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_file_exhaustive.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/ruby/test_file_exhaustive.rb b/test/ruby/test_file_exhaustive.rb
index 3e030309b6..4538cf3b61 100644
--- a/test/ruby/test_file_exhaustive.rb
+++ b/test/ruby/test_file_exhaustive.rb
@@ -399,6 +399,13 @@ class TestFileExhaustive < Test::Unit::TestCase
assert_file.not_zero?(nofile)
end
+ def test_empty_p
+ assert_nothing_raised { File.empty?(@dir) }
+ assert_file.not_empty?(regular_file)
+ assert_file.empty?(zerofile)
+ assert_file.not_empty?(nofile)
+ end
+
def test_size_p
assert_nothing_raised { File.size?(@dir) }
assert_equal(3, File.size?(regular_file))