summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-10-30 07:28:03 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-10-30 07:28:03 +0000
commitd30ab696cdd0b081558e7ba391960525191314a8 (patch)
treeb73bff3b0bbed518f9fe0d38d6dbf355c4803dae /test
parenta6cbf12774c745323918f9f712f89019af38bf18 (diff)
downloadruby-d30ab696cdd0b081558e7ba391960525191314a8.tar.gz
ruby-d30ab696cdd0b081558e7ba391960525191314a8.tar.xz
ruby-d30ab696cdd0b081558e7ba391960525191314a8.zip
* test/ruby/test_enum.rb (test_count): test for [ruby-core:24794].
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@25571 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_enum.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/ruby/test_enum.rb b/test/ruby/test_enum.rb
index 077be1767..a805ee6e5 100644
--- a/test/ruby/test_enum.rb
+++ b/test/ruby/test_enum.rb
@@ -35,6 +35,15 @@ class TestEnumerable < Test::Unit::TestCase
assert_equal(3, @obj.count {|x| x % 2 == 1 })
assert_equal(2, @obj.count(1) {|x| x % 2 == 1 })
assert_raise(ArgumentError) { @obj.count(0, 1) }
+
+ en = Class.new {
+ include Enumerable
+ alias :size :count
+ def each
+ yield 1
+ end
+ }
+ assert_equal(1, en.new.count, '[ruby-core:24794]')
end
def test_find