mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
Change Enumberal#several? to Enumberal#many?
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
|
||||
* Added Object#present? which is equivalent to !Object#blank? [DHH]
|
||||
|
||||
* Added Enumberable#several? to encapsulate collection.size > 1 [DHH]
|
||||
* Added Enumberable#many? to encapsulate collection.size > 1 [DHH]
|
||||
|
||||
* Add more standard Hash methods to ActiveSupport::OrderedHash [Steve Purcell]
|
||||
|
||||
|
||||
@@ -79,7 +79,7 @@ module Enumerable
|
||||
end
|
||||
|
||||
# Returns true if the collection has more than 1 element. Functionally equivalent to collection.size > 1.
|
||||
def several?
|
||||
def many?
|
||||
size > 1
|
||||
end
|
||||
end
|
||||
|
||||
@@ -65,8 +65,8 @@ class EnumerableTests < Test::Unit::TestCase
|
||||
end
|
||||
|
||||
def test_several
|
||||
assert ![].several?
|
||||
assert ![ 1 ].several?
|
||||
assert [ 1, 2 ].several?
|
||||
assert ![].many?
|
||||
assert ![ 1 ].many?
|
||||
assert [ 1, 2 ].many?
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user