From ecdd432f5746a525a11b872c73308b9b20dd88ad Mon Sep 17 00:00:00 2001 From: Anupam Choudhury Date: Thu, 4 Apr 2013 20:35:11 +0530 Subject: Replaced inject with map --- activesupport/test/core_ext/enumerable_test.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'activesupport/test') diff --git a/activesupport/test/core_ext/enumerable_test.rb b/activesupport/test/core_ext/enumerable_test.rb index 161e9ba1c3..a00b2dcf35 100644 --- a/activesupport/test/core_ext/enumerable_test.rb +++ b/activesupport/test/core_ext/enumerable_test.rb @@ -24,10 +24,10 @@ class EnumerableTests < ActiveSupport::TestCase def test_group_by names = %w(marcel sam david jeremy) klass = Struct.new(:name) - objects = (1..50).inject([]) do |people| + objects = (1..50).map do p = klass.new p.name = names.sort_by { rand }.first - people << p + p end enum = GenericEnumerable.new(objects) -- cgit v1.2.3