diff options
author | codebrulee <kevin@codebrulee.com> | 2009-05-04 12:36:22 -0400 |
---|---|---|
committer | Michael Koziarski <michael@koziarski.com> | 2009-05-04 10:01:01 -0700 |
commit | eb201e64c0b68aee6d0715d44cf48178204c4133 (patch) | |
tree | 377d55354d1131b5e7048753111ca47070102cd4 /activesupport/test | |
parent | 8b6d2ef2f562c34ebc2ef547b0a18c31f5820569 (diff) | |
download | rails-eb201e64c0b68aee6d0715d44cf48178204c4133.tar.gz rails-eb201e64c0b68aee6d0715d44cf48178204c4133.tar.bz2 rails-eb201e64c0b68aee6d0715d44cf48178204c4133.zip |
Fixed Hash#from_xml with keys that are all caps.
Signed-off-by: Michael Koziarski <michael@koziarski.com>
Diffstat (limited to 'activesupport/test')
-rw-r--r-- | activesupport/test/core_ext/hash_ext_test.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/activesupport/test/core_ext/hash_ext_test.rb b/activesupport/test/core_ext/hash_ext_test.rb index d65a5323bf..ece5466abb 100644 --- a/activesupport/test/core_ext/hash_ext_test.rb +++ b/activesupport/test/core_ext/hash_ext_test.rb @@ -646,6 +646,22 @@ class HashToXmlTest < Test::Unit::TestCase assert_equal expected_topic_hash, Hash.from_xml(topic_xml)["rsp"]["photos"]["photo"] end + def test_all_caps_key_from_xml + test_xml = <<-EOT + <ABC3XYZ> + <TEST>Lorem Ipsum</TEST> + </ABC3XYZ> + EOT + + expected_hash = { + "ABC3XYZ" => { + "TEST" => "Lorem Ipsum" + } + } + + assert_equal expected_hash, Hash.from_xml(test_xml) + end + def test_empty_array_from_xml blog_xml = <<-XML <blog> |