aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/core_ext/hash_ext_test.rb
Commit message (Collapse)AuthorAgeFilesLines
* Hash.from_xml: datetime xml types overflow to Ruby DateTime class when out ↵gbuesing2008-05-181-0/+38
| | | | of range of Time. Adding tests for utc offsets
* Revert [9209] Use Hash#exceptPratik Naik2008-04-021-32/+0
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9210 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Adding Hash#without Closes #7369 [eventualbuddha]Pratik Naik2008-04-021-0/+32
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9209 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Use a decorator module for Files instantiated by Hash.from_xml. Add test ↵Jeremy Kemper2008-01-061-3/+31
| | | | | | coverage. Closes #10726 [Cheah Chu Yeow] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8579 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* 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
* Hash#symbolize_keys skips keys that can't be symbolized. Closes #10500.Jeremy Kemper2007-12-201-3/+9
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8454 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Ruby 1.9 compat: shadowed vars, kcodeJeremy Kemper2007-12-151-3/+3
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8402 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fix HashWithIndifferentAccess#to_options! so it doesn't clear the options ↵Rick Olson2007-12-081-0/+8
| | | | | | hash. Closes #10419 [ReinH] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8332 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fix that empty collections should be treated as empty arrays regardless of ↵David Heinemeier Hansson2007-11-251-0/+11
| | | | | | whitespace for Hash#from_xml (closes #10255) [adamj] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8202 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Hash#to_xml handles symbol values. Closes #9954.Jeremy Kemper2007-10-231-2/+5
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7997 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Hash#symbolize_keys behaves well with integer keys. Closes #9890.Jeremy Kemper2007-10-161-0/+6
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7945 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Ruby 1.9 compat, consistent load pathsJeremy Kemper2007-10-021-3/+3
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7719 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Ruby 1.9 compat for hash_ext_testJeremy Kemper2007-09-291-1/+1
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7686 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Hash#to_xml doesn't double-unescape. Closes #8806.Jeremy Kemper2007-09-171-0/+28
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7505 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Support for non heterogeneous arrays when serializing to xml. Unless ↵Tobias Lütke2007-07-091-0/+17
| | | | | | guessable from array name the type name will be included as attribute git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7173 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Added Hash#except which is the inverse of Hash#slice -- return the hash ↵David Heinemeier Hansson2007-07-091-0/+13
| | | | | | except the keys that are specified [DHH] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7172 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Added proper handling of arrays. Closes #8537 [hasmanyjosh]Rick Olson2007-06-211-4/+39
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7074 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* revert [6924]Rick Olson2007-06-051-37/+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/+37
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6924 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Pull file from xml value only if it's a Hash. Closes #8190.Jeremy Kemper2007-04-261-0/+6
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6583 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Use XSD-compatible type names for Hash#to_xml and make the converters ↵David Heinemeier Hansson2007-04-211-1/+29
| | | | | | extendable #8047 [Tim Pope] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6546 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Added yielding of builder in Hash#to_xml [DHH]David Heinemeier Hansson2007-04-191-0/+11
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6540 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fixed that parameters from XML should also be presented in a hash with ↵David Heinemeier Hansson2007-04-161-0/+5
| | | | | | indifferent access [DHH] Hash#with_indifferent_access now also converts hashes kept in arrays to indifferent access (makes it easier to treat HTML and XML parameters the same) [DHH] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6532 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Hash#to_xml supports YAML attributes; ActiveRecord::Base#to_xml support ↵Jeremy Kemper2007-03-181-3/+5
| | | | | | serialized attributes. Closes #7502. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6444 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Array#to_query preserves its ordering. References #7756.Jeremy Kemper2007-03-111-2/+7
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6378 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Hash#to_query CGI-escapes its keys.Jeremy Kemper2007-02-111-8/+22
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6148 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Don't test for hash sort order.Jeremy Kemper2007-02-111-6/+7
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6147 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Added Hash#to_query to turn a hash of values into a form-encoded query ↵David Heinemeier Hansson2007-01-241-0/+21
| | | | | | string [Nicholas Seckar] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6038 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Hash#slice(*keys) returns a new hash with only the given keys. #slice! ↵Jeremy Kemper2006-12-171-0/+29
| | | | | | replaces the hash with only the given keys. Works with HashWithIndifferentAccess also. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5726 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* HashWithIndifferentAccess#to_hash converts to a Hash with String keys and ↵Jeremy Kemper2006-12-161-9/+37
| | | | | | the same default value. Fix Hash#reverse_update to be an alias for reverse_merge./script/console More thoroughly test the reverse_* methods. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5725 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Hash#to_xml handles keys with the same name as Kernel methods. Closes #6613.Jeremy Kemper2006-11-141-0/+11
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5521 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Hash#to_xml supports Bignum and BigDecimal. Closes #6313.Jeremy Kemper2006-09-291-1/+7
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5209 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Hash.create_from_xml has been renamed to Hash.from_xml, alias will exist ↵David Heinemeier Hansson2006-09-201-4/+4
| | | | | | until Rails 2.0 [DHH] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5149 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fix cases where empty xml nodes weren't being translated to nil in ↵Rick Olson2006-09-011-0/+24
| | | | | | Hash.create_from_xml [Rick Olson] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4895 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Strip boolean XML content before checking for 'true' [Rick Olson]Rick Olson2006-07-211-2/+2
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4616 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Correctly convert <foo nil=true> to nil when using Hash.create_from_xml. [Rick]Rick Olson2006-07-131-1/+1
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4607 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* r4487@asus: jeremy | 2006-04-29 12:21:39 -0700Jeremy Kemper2006-07-081-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Check whether @flash is defined? for warnings-safety. r4488@asus: jeremy | 2006-04-29 12:23:15 -0700 Check whether @flash is defined? for warnings-safety. Obviates nil? check. r4489@asus: jeremy | 2006-04-29 12:45:18 -0700 Check whether @session is defined? for warnings-safety. r4490@asus: jeremy | 2006-04-29 12:50:41 -0700 Check whether @rendering_runtime is defined? for warnings-safety. r4491@asus: jeremy | 2006-04-29 12:55:01 -0700 Check whether @_cycles is defined? for warnings-safety. r4492@asus: jeremy | 2006-04-29 12:59:19 -0700 Check whether instance variables are defined? for warnings-safety. r4493@asus: jeremy | 2006-04-29 13:14:09 -0700 Add nil @template to PrototypeHelperTest to suppress unitialized instance variable warning. r4494@asus: jeremy | 2006-04-29 13:31:34 -0700 Check whether @auto_index defined? for warnings-safety. r4495@asus: jeremy | 2006-04-29 13:32:24 -0700 Wrap content_columns redefinitions with silence_warnings. r4496@asus: jeremy | 2006-04-29 13:35:28 -0700 Wrap more redefinitions with silence_warnings. r4829@asus: jeremy | 2006-07-08 10:59:20 -0700 abstract unit, fix warnings r4830@asus: jeremy | 2006-07-08 11:06:12 -0700 Use parens to silence warning. r4831@asus: jeremy | 2006-07-08 11:06:48 -0700 Use parens to silence warning. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4595 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* HashWithIndifferentAccess shouldn't confuse false and nil. Closes #5601. Nor ↵Jeremy Kemper2006-07-051-31/+58
| | | | | | should it mistreat legitimate nil values. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4555 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fixed HashWithIndifferentAccess#default (closes #5586) [chris@seagul.co.uk]David Heinemeier Hansson2006-07-051-0/+22
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4539 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* More compatible Hash.create_from_xml. Closes #5523.Jeremy Kemper2006-06-291-0/+23
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4510 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Added Hash.create_from_xml(string) which will create a hash from a XML ↵David Heinemeier Hansson2006-06-161-1/+78
| | | | | | string and even typecast if possible [DHH] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4453 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* to_xml fixes, features, and speedup. Closes #4989.Jeremy Kemper2006-06-031-4/+35
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4413 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Don't destroy a HashWithIndifferentAccess if symbolize_keys! or ↵Marcel Molina2006-05-141-0/+11
| | | | | | stringify_keys! is called on it. Closes #5076. [Marcel Molina Jr., guy.naor@famundo.com] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4339 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Added nicer message for assert_redirected_to (closes #4294) [court3nay, ↵Rick Olson2006-03-191-1/+5
| | | | | | Chris McGrath] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3969 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fixed HashWithIndifferentAccess#delete to work with both symbols and strings ↵David Heinemeier Hansson2006-03-181-0/+10
| | | | | | (closes #2176) [Caio Chassot] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3912 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Implemented nested to_xml and named elements for array xmling [DHH]David Heinemeier Hansson2006-03-091-0/+15
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3830 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fixed to_xml across the board to use nice indention, better skip_attributes ↵David Heinemeier Hansson2006-03-091-14/+31
| | | | | | workings, no type on strings, and cleaned tests [DHH] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3829 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Added Hash#to_xml and Array#to_xml that makes it much easier to produce XML ↵David Heinemeier Hansson2006-03-081-1/+29
| | | | | | from basic structures [DHH] Moved Jim Weirich's wonderful Builder from Action Pack to Active Support (it's simply too useful to be stuck in AP) [DHH] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3812 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fix merge and dup for hashes with indifferent access (closes #3404) ↵David Heinemeier Hansson2006-01-231-0/+19
| | | | | | [kenneth.miller@bitfield.net] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3468 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Make HashWithIndifferentAccess#update behave like Hash#update by returning ↵Marcel Molina2006-01-081-0/+23
| | | | | | the hash. Closes #3419, #3425 git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3388 5ecf4fe2-1ee6-0310-87b1-e25e094e27de