diff options
Diffstat (limited to 'activesupport/test')
-rw-r--r-- | activesupport/test/core_ext/enumerable_test.rb | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/activesupport/test/core_ext/enumerable_test.rb b/activesupport/test/core_ext/enumerable_test.rb index 97e3ff6377..234dc98de8 100644 --- a/activesupport/test/core_ext/enumerable_test.rb +++ b/activesupport/test/core_ext/enumerable_test.rb @@ -15,9 +15,13 @@ class EnumerableTests < Test::Unit::TestCase people << p end - objects.group_by {|object| object.name}.each do |name, group| - assert group.all? {|person| person.name == name} + grouped = objects.group_by { |object| object.name } + + grouped.each do |name, group| + assert group.all? { |person| person.name == name } end + + assert_equal objects.uniq.map(&:name), grouped.map { |name, group| name } end def test_sums |