diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-04-13 05:47:49 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-04-13 05:47:49 +0000 |
commit | 2b8b2ea9edda52d3fdab93351b563c9c6887730d (patch) | |
tree | 7c787eebc746b7856989278608310ba02f2c8229 /test | |
parent | fe840f2896472beea7d31be993eabfd49c27272b (diff) | |
download | ruby-2b8b2ea9edda52d3fdab93351b563c9c6887730d.tar.gz |
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.rb | 7 |
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)) |