aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/core_ext/array_ext_test.rb
Commit message (Collapse)AuthorAgeFilesLines
* Ensure Array#to_sentence does not modify given hashCarlos Antonio da Silva2012-06-261-0/+6
| | | | | Also simplify I18n logic for Array#to_sentence, doing only one lookup for all keys and using merge!, instead of one lookup for each option key.
* use AS::TestCase as the base classAaron Patterson2012-01-051-11/+11
|
* deprecate Array#uniq_by and Array#uniq_by! in favor of Array#uniq and ↵Vasiliy Ermolovich2011-12-221-6/+14
| | | | Array#uniq! from ruby 1.9
* remove Array#sample from core_extVasiliy Ermolovich2011-12-211-28/+0
|
* Remove trailing whitespaceDaniel Schierbeck2011-08-231-2/+2
|
* Added Array#prepend as an alias for Array#unshift and Array#append as an ↵David Heinemeier Hansson2011-08-151-0/+10
| | | | alias for Array#<< [DHH]
* Array.wrap should follow Kernel#Array semantics when the object's to_ary is ↵Jon Leighton2011-06-301-2/+3
| | | | nil. In this case, the object should be wrapped.
* fixing Array#from to return consistent resultsJared McFarland2011-04-261-1/+1
|
* to_sentence should return a duplicateMatthew Mongeau2010-08-171-0/+5
|
* Deletes trailing whitespaces (over text files only find * -type f -exec sed ↵Santiago Pastorino2010-08-141-6/+6
| | | | 's/[ \t]*$//' -i {} \;)
* adds test coverage for edge-cases of Array.wrap, and better documentation ↵Xavier Noria2010-07-281-0/+20
| | | | for how it differs from Kernel#Array
* removes Array#random_element and backports Array#sample from Ruby 1.9, ↵Xavier Noria2010-06-051-7/+23
| | | | thanks to Marc-Andre Lafortune
* Renames Array#rand -> Array#random_elementRizwan Reza2010-05-171-4/+0
| | | | Signed-off-by: Xavier Noria <fxn@hashref.com>
* Change on Array extension from rand => random_element [#4555 state:committed]Santiago Pastorino2010-05-161-4/+8
| | | | Signed-off-by: Xavier Noria <fxn@hashref.com>
* array.to_xml should be able to handle all types of data elements [#4490 ↵Neeraj Singh2010-04-291-5/+5
| | | | | | state:resolved] Signed-off-by: José Valim <jose.valim@gmail.com>
* Limit Array#extract_options! to directl instances of Hash and HWIA. Add ↵wycats2010-03-271-0/+34
| | | | extractable_options? to Hash so that subclasses of Hash can opt-into extractable behavior. This fixes an issue where respond_with wasn't working with subclasses of Hash that were provided by other libraries (such as CouchDB or Mashie) [#4145 state:resolved]
* no more interpreted as grouped expression warnings on array_ext_testSantiago Pastorino2010-02-261-2/+2
|
* Remove deprecated behavior since 2.3.José Valim and Mikel Lindsaar2010-01-241-17/+1
|
* Add uniq_by and uniq_by! to Array.José Valim and Mikel Lindsaar2010-01-241-3/+23
|
* Test that Array.wrap works with proxy objects and structsJeremy Kemper2009-11-131-0/+20
|
* Fix that Hash#to_xml and Array#to_xml shouldn't modify their options hashes ↵David Burger2009-08-091-0/+7
| | | | | | [#672 state:resolved] Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* Fix dependencies revealed by testing in isolationJeremy Kemper2009-04-221-0/+3
|
* Explicit BigDecimal extension dependencyJeremy Kemper2009-03-291-1/+1
|
* Explicit test dependenciesJeremy Kemper2009-03-291-0/+1
|
* Deprecated warnings for :skip_last_command and :connector of to_sentence ↵Guillermo Álvarez2009-02-221-0/+18
| | | | | | [#1847 state:committed] Signed-off-by: David Heinemeier Hansson <david@loudthinking.com>
* Array#wrap should use #to_ary so association collections and named scopes ↵Will Bryant2009-02-101-0/+10
| | | | | | | | are not re-wrapped [#1935 state:committed] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* Introduce Array.wrap(foo) to wrap the argument in an array unless it's ↵Jeremy Kemper2009-02-061-0/+24
| | | | already an array. Wraps nil as an empty array. Use instead of Array(foo) and foo.to_a since they treat String as Enumerable.
* Change Array#to_sentence I18n options to pass comma and space character from ↵Akira Matsuda2008-12-081-9/+10
| | | | | | | | outside. [#1397 state:committed] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* Require mocha >= 0.9.0 for AS testsJeremy Kemper2008-11-221-9/+7
|
* Added ActiveSupport::BacktraceCleaner and Rails::BacktraceCleaner for ↵David Heinemeier Hansson2008-11-221-1/+1
| | | | cutting down on backtrace noise (inspired by the Thoughtbot Quiet Backtrace plugin) [DHH]
* Reduced the number of literal aliases to the range that has actually seen ↵David Heinemeier Hansson2008-11-211-6/+2
| | | | personal use. With the massive savings in overhead, I was able to fit Array#forty_two
* Add in_groups to ActiveSupport::CoreExtensions::Array::Grouping. [#579 ↵Adrian Mugnolo2008-07-151-4/+46
| | | | | | state:resolved] Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* Added Array#second through Array#tenth as aliases for Array#[1] through ↵David Heinemeier Hansson2008-06-171-0/+14
| | | | Array#[9] [DHH]
* Fixed ambiguous first argument warning in ArrayExtTest.Joshua Peek2008-06-031-14/+12
|
* Added tests [#279 state:resolved] (Nicholas Schlueter)David Heinemeier Hansson2008-06-021-0/+5
|
* require abstract_unit directly since test is in load pathJeremy Kemper2008-01-051-1/+1
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8563 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Added that Array#to_param calls to_param on all it's elements (closes ↵David Heinemeier Hansson2007-12-141-0/+10
| | | | | | #10473) [brandon] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8384 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* to_sentence returns self[0].to_s instead of just self[0] for arrays of ↵Jeremy Kemper2007-12-091-1/+3
| | | | | | length 1. Closes #10390 [Chu Yeow, mrj] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8340 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fix potential extra space in Array#to_sentence. Closes #10327 [kamal]Michael Koziarski2007-12-021-0/+6
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8251 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Added Array#from and Array#to that behaves just from String#from and ↵David Heinemeier Hansson2007-11-271-0/+14
| | | | | | String#to [DHH] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8224 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Added Array#rand (closes #9170) [norbert]David Heinemeier Hansson2007-09-151-0/+16
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7486 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Some 1.9 forward compatibilityJeremy Kemper2007-09-141-4/+4
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7474 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Added Array#extract_options! to encapsulate the pattern of getting an ↵David Heinemeier Hansson2007-07-241-0/+9
| | | | | | options hash out of a variable number of parameters (closes #8759) [norbert] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7217 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Added proper handling of arrays. Closes #8537 [hasmanyjosh]Rick Olson2007-06-211-2/+2
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7074 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* revert [6924]Rick Olson2007-06-051-2/+2
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6946 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Added proper handling of arrays (closes #8537) [hasmanyjosh]David Heinemeier Hansson2007-06-011-2/+2
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6924 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Array#to_xml yields the builder just like Hash and ActiveRecord::Base. ↵Jeremy Kemper2007-05-261-0/+11
| | | | | | Closes #8472. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6858 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Use XSD-compatible type names for Hash#to_xml and make the converters ↵David Heinemeier Hansson2007-04-211-1/+1
| | | | | | extendable #8047 [Tim Pope] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6546 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Silence warnings; use more precise assertions.Jeremy Kemper2006-12-161-2/+2
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5724 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fix remove_constant to correctly handle constant names of the form ↵Nicholas Seckar2006-12-091-1/+1
| | | | | | "::A::...". References #6720. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5710 5ecf4fe2-1ee6-0310-87b1-e25e094e27de