From 363c08fa6033a53c1fed18288921c98e70484064 Mon Sep 17 00:00:00 2001 From: Carlos Antonio da Silva Date: Thu, 4 Apr 2013 12:36:17 -0300 Subject: [PATCH] Further simplify enumerable group_by test --- activesupport/test/core_ext/enumerable_test.rb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/activesupport/test/core_ext/enumerable_test.rb b/activesupport/test/core_ext/enumerable_test.rb index a00b2dcf35..6781e3c20e 100644 --- a/activesupport/test/core_ext/enumerable_test.rb +++ b/activesupport/test/core_ext/enumerable_test.rb @@ -25,9 +25,7 @@ class EnumerableTests < ActiveSupport::TestCase names = %w(marcel sam david jeremy) klass = Struct.new(:name) objects = (1..50).map do - p = klass.new - p.name = names.sort_by { rand }.first - p + klass.new names.sample end enum = GenericEnumerable.new(objects)