Adding Enumerable#filter_map

[Feature #15323]
Closes: https://github.com/ruby/ruby/pull/2017
This commit is contained in:
Alfonso Jiménez 2018-11-20 11:51:08 +01:00 committed by Nobuyoshi Nakada
parent 1ccc2eeba0
commit 0acbdd1ed0
No known key found for this signature in database
GPG key ID: 4BC7D6DF58D8DF60
4 changed files with 78 additions and 1 deletions

View file

@ -542,7 +542,7 @@ class TestEnumerator < Test::Unit::TestCase
def test_size_for_enum_created_from_enumerable
%i[find_all reject map flat_map partition group_by sort_by min_by max_by
minmax_by each_with_index reverse_each each_entry].each do |method|
minmax_by each_with_index reverse_each each_entry filter_map].each do |method|
assert_equal nil, @obj.send(method).size
assert_equal 42, @sized.send(method).size
end