From 3a3e250975d0ce34b0e5628a2fc2a3bfa7722188 Mon Sep 17 00:00:00 2001 From: knu Date: Thu, 29 May 2008 19:18:54 +0000 Subject: * enum.c (enum_count, count_all_i, Init_Enumerable), array.c (rb_ary_count): If no argument or block is given, count the number of all elements. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16693 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_enum.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'test/ruby/test_enum.rb') diff --git a/test/ruby/test_enum.rb b/test/ruby/test_enum.rb index 97b4ec468b..a739982963 100644 --- a/test/ruby/test_enum.rb +++ b/test/ruby/test_enum.rb @@ -30,6 +30,7 @@ class TestEnumerable < Test::Unit::TestCase end def test_count + assert_equal(5, @obj.count) assert_equal(2, @obj.count(1)) assert_equal(3, @obj.count {|x| x % 2 == 1 }) assert_equal(2, @obj.count(1) {|x| x % 2 == 1 }) -- cgit v1.2.3