diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2007-10-16 18:56:13 +0000 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2007-10-16 18:56:13 +0000 |
commit | cfffedb4d86bcf3190da5e6433b694fc2e9f1bd9 (patch) | |
tree | cb3fea4f87f93a3e7430a7da92eb071036e66a09 /activesupport/test | |
parent | a2172e75f589f038ed10806e9a32be99d4d69f89 (diff) | |
download | rails-cfffedb4d86bcf3190da5e6433b694fc2e9f1bd9.tar.gz rails-cfffedb4d86bcf3190da5e6433b694fc2e9f1bd9.tar.bz2 rails-cfffedb4d86bcf3190da5e6433b694fc2e9f1bd9.zip |
Hash#symbolize_keys behaves well with integer keys. Closes #9890.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7945 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activesupport/test')
-rw-r--r-- | activesupport/test/core_ext/hash_ext_test.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/activesupport/test/core_ext/hash_ext_test.rb b/activesupport/test/core_ext/hash_ext_test.rb index 5691ec7c1c..359eacaba3 100644 --- a/activesupport/test/core_ext/hash_ext_test.rb +++ b/activesupport/test/core_ext/hash_ext_test.rb @@ -5,6 +5,7 @@ class HashExtTest < Test::Unit::TestCase @strings = { 'a' => 1, 'b' => 2 } @symbols = { :a => 1, :b => 2 } @mixed = { :a => 1, 'b' => 2 } + @fixnums = { 0 => 1, 1 => 2 } end def test_methods @@ -33,6 +34,11 @@ class HashExtTest < Test::Unit::TestCase assert_raises(NoMethodError) { { [] => 1 }.symbolize_keys } end + def test_symbolize_keys_preserves_fixnum_keys + assert_equal @fixnums, @fixnums.symbolize_keys + assert_equal @fixnums, @fixnums.dup.symbolize_keys! + end + def test_stringify_keys assert_equal @strings, @symbols.stringify_keys assert_equal @strings, @strings.stringify_keys |