aboutsummaryrefslogtreecommitdiffstats
path: root/test/ruby/test_enumerator.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/ruby/test_enumerator.rb')
-rw-r--r--test/ruby/test_enumerator.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/ruby/test_enumerator.rb b/test/ruby/test_enumerator.rb
index 3143be21a0..c276455a01 100644
--- a/test/ruby/test_enumerator.rb
+++ b/test/ruby/test_enumerator.rb
@@ -420,5 +420,14 @@ class TestEnumerator < Test::Unit::TestCase
assert_equal 42, enum.with_index.size
assert_equal 42, enum.with_object(:foo).size
end
+
+ def test_size_for_enum_created_from_array
+ arr = %w[hello world]
+ %i[each each_with_index reverse_each sort_by! sort_by map map!
+ keep_if reject! reject select! select delete_if].each do |method|
+ assert_equal arr.size, arr.send(method).size
+ end
+ end
+
end