diff options
author | Eugene Kenny <elkenny@gmail.com> | 2017-04-25 07:40:51 -0700 |
---|---|---|
committer | Eugene Kenny <elkenny@gmail.com> | 2017-04-25 07:40:51 -0700 |
commit | 90f851a18b1aca6323c77d21153761e36f864079 (patch) | |
tree | c5aea654de065fc779e35b59df14dc73c3773845 /activesupport | |
parent | c2e3e0d2096836bfb6072af70bd0914a960a50fe (diff) | |
download | rails-90f851a18b1aca6323c77d21153761e36f864079.tar.gz rails-90f851a18b1aca6323c77d21153761e36f864079.tar.bz2 rails-90f851a18b1aca6323c77d21153761e36f864079.zip |
Remove checks for Enumerator#size method
The Enumerator#size method was introduced in Ruby 2.0.
These tests were added when Rails 4.1 was current, and Ruby 1.9.3 was
still supported. Since Rails 5 only Ruby >= 2.2.2 is supported, so the
checks are no longer necessary.
Diffstat (limited to 'activesupport')
-rw-r--r-- | activesupport/test/core_ext/enumerable_test.rb | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/activesupport/test/core_ext/enumerable_test.rb b/activesupport/test/core_ext/enumerable_test.rb index 4f1ab993b8..0b345ecf0f 100644 --- a/activesupport/test/core_ext/enumerable_test.rb +++ b/activesupport/test/core_ext/enumerable_test.rb @@ -171,10 +171,8 @@ class EnumerableTests < ActiveSupport::TestCase assert_equal({ 5 => Payment.new(5), 15 => Payment.new(15), 10 => Payment.new(10) }, payments.index_by(&:price)) assert_equal Enumerator, payments.index_by.class - if Enumerator.method_defined? :size - assert_nil payments.index_by.size - assert_equal 42, (1..42).index_by.size - end + assert_nil payments.index_by.size + assert_equal 42, (1..42).index_by.size assert_equal({ 5 => Payment.new(5), 15 => Payment.new(15), 10 => Payment.new(10) }, payments.index_by.each(&:price)) end |