diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2008-06-12 17:46:15 -0500 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2008-06-12 17:46:15 -0500 |
commit | 556204abaf95f7c995576cb1358f13de406682ab (patch) | |
tree | a84387ac04af8377b25c4c283a522dc82639bb53 /activesupport/test/core_ext | |
parent | ed0cb91a830f317e3a8192a90294c1005f6156c2 (diff) | |
download | rails-556204abaf95f7c995576cb1358f13de406682ab.tar.gz rails-556204abaf95f7c995576cb1358f13de406682ab.tar.bz2 rails-556204abaf95f7c995576cb1358f13de406682ab.zip |
Added Enumberable#several? to encapsulate collection.size > 1 [DHH]
Diffstat (limited to 'activesupport/test/core_ext')
-rw-r--r-- | activesupport/test/core_ext/enumerable_test.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/activesupport/test/core_ext/enumerable_test.rb b/activesupport/test/core_ext/enumerable_test.rb index f5facd54ad..c37e0d269e 100644 --- a/activesupport/test/core_ext/enumerable_test.rb +++ b/activesupport/test/core_ext/enumerable_test.rb @@ -63,4 +63,10 @@ class EnumerableTests < Test::Unit::TestCase assert_equal({ 5 => payments[0], 15 => payments[1], 10 => payments[2] }, payments.index_by { |p| p.price }) end + + def test_several + assert ![].several? + assert ![ 1 ].several? + assert [ 1, 2 ].several? + end end |