From 7660e7cb4df69ad127661ad87f495a3b212170b9 Mon Sep 17 00:00:00 2001 From: Andre Arko Date: Thu, 14 Apr 2011 16:25:08 +0800 Subject: attributes no longer disappear if a tag contains whitespace old: Hash.from_xml("\n") => {"tag"=>"\n"} new: Hash.from_xml("\n") => {"tag"=>{"foo"=>"bar", "__content__"=>"\n"} --- activesupport/test/core_ext/hash_ext_test.rb | 9 +++++++++ 1 file changed, 9 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 a0479d45ac..012b956d7f 100644 --- a/activesupport/test/core_ext/hash_ext_test.rb +++ b/activesupport/test/core_ext/hash_ext_test.rb @@ -889,6 +889,15 @@ class HashToXmlTest < Test::Unit::TestCase assert_equal 'application/octet-stream', file.content_type end + def test_tag_with_attrs_and_whitespace + xml = <<-XML + + + XML + hash = Hash.from_xml(xml) + assert_equal "bacon is the best", hash['blog']['name'] + end + def test_xsd_like_types_from_xml bacon_xml = <<-EOT -- cgit v1.2.3