diff options
author | lest <just.lest@gmail.com> | 2011-12-21 19:07:00 +0300 |
---|---|---|
committer | lest <just.lest@gmail.com> | 2011-12-21 19:07:00 +0300 |
commit | f1b4cacbae71585be3f5dcb4c1bdd7c78ef3d590 (patch) | |
tree | e549015f243c56c35f6ee4ae98aff2c5ed9f0423 /activesupport/test | |
parent | 707eed72d33ab5048ad1545df4fc1f81652379af (diff) | |
download | rails-f1b4cacbae71585be3f5dcb4c1bdd7c78ef3d590.tar.gz rails-f1b4cacbae71585be3f5dcb4c1bdd7c78ef3d590.tar.bz2 rails-f1b4cacbae71585be3f5dcb4c1bdd7c78ef3d590.zip |
remove Enumerable#each_with_object from core_ext as it is present in ruby 1.9
Diffstat (limited to 'activesupport/test')
-rw-r--r-- | activesupport/test/core_ext/enumerable_test.rb | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/activesupport/test/core_ext/enumerable_test.rb b/activesupport/test/core_ext/enumerable_test.rb index 7ce7c4d52d..7c2aec3462 100644 --- a/activesupport/test/core_ext/enumerable_test.rb +++ b/activesupport/test/core_ext/enumerable_test.rb @@ -86,15 +86,6 @@ class EnumerableTests < Test::Unit::TestCase assert_equal 'abc', ('a'..'c').sum end - def test_each_with_object - enum = GenericEnumerable.new(%w(foo bar)) - result = enum.each_with_object({}) { |str, hsh| hsh[str] = str.upcase } - assert_equal({'foo' => 'FOO', 'bar' => 'BAR'}, result) - assert_equal Enumerator, enum.each_with_object({}).class - result2 = enum.each_with_object({}).each{|str, hsh| hsh[str] = str.upcase} - assert_equal result, result2 - end - def test_index_by payments = GenericEnumerable.new([ Payment.new(5), Payment.new(15), Payment.new(10) ]) assert_equal({ 5 => Payment.new(5), 15 => Payment.new(15), 10 => Payment.new(10) }, @@ -133,4 +124,4 @@ class EnumerableTests < Test::Unit::TestCase assert_equal [ "David", "Jamie" ], people.pluck(:name) end -end
\ No newline at end of file +end |