aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test
diff options
context:
space:
mode:
authorAnupam Choudhury <contact2anupam@gmail.com>2013-04-04 20:35:11 +0530
committerAnupam Choudhury <contact2anupam@gmail.com>2013-04-04 20:36:27 +0530
commitecdd432f5746a525a11b872c73308b9b20dd88ad (patch)
treef7f61ecfb46f677d26d849e4bab4440be04e80d3 /activesupport/test
parentf73140fd4773a1de47017eb0d053a4164c9f3747 (diff)
downloadrails-ecdd432f5746a525a11b872c73308b9b20dd88ad.tar.gz
rails-ecdd432f5746a525a11b872c73308b9b20dd88ad.tar.bz2
rails-ecdd432f5746a525a11b872c73308b9b20dd88ad.zip
Replaced inject with map
Diffstat (limited to 'activesupport/test')
-rw-r--r--activesupport/test/core_ext/enumerable_test.rb4
1 files changed, 2 insertions, 2 deletions
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)