From eb201e64c0b68aee6d0715d44cf48178204c4133 Mon Sep 17 00:00:00 2001 From: codebrulee Date: Mon, 4 May 2009 12:36:22 -0400 Subject: Fixed Hash#from_xml with keys that are all caps. Signed-off-by: Michael Koziarski --- activesupport/test/core_ext/hash_ext_test.rb | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'activesupport/test/core_ext/hash_ext_test.rb') 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 + + Lorem Ipsum + + 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 -- cgit v1.2.3