aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/core_ext/hash_ext_test.rb
diff options
context:
space:
mode:
authorRick Olson <technoweenie@gmail.com>2007-06-05 14:09:15 +0000
committerRick Olson <technoweenie@gmail.com>2007-06-05 14:09:15 +0000
commited1ed9ed97f7d30ba8221079365634aa9c4bf24c (patch)
tree4564504ab18ee63adf2191595513141833430245 /activesupport/test/core_ext/hash_ext_test.rb
parent319107ae40bc00772f4eaf91ab9531097bc537cb (diff)
downloadrails-ed1ed9ed97f7d30ba8221079365634aa9c4bf24c.tar.gz
rails-ed1ed9ed97f7d30ba8221079365634aa9c4bf24c.tar.bz2
rails-ed1ed9ed97f7d30ba8221079365634aa9c4bf24c.zip
revert [6924]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6946 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activesupport/test/core_ext/hash_ext_test.rb')
-rw-r--r--activesupport/test/core_ext/hash_ext_test.rb39
1 files changed, 2 insertions, 37 deletions
diff --git a/activesupport/test/core_ext/hash_ext_test.rb b/activesupport/test/core_ext/hash_ext_test.rb
index 73b873aee8..a428fe5061 100644
--- a/activesupport/test/core_ext/hash_ext_test.rb
+++ b/activesupport/test/core_ext/hash_ext_test.rb
@@ -370,7 +370,7 @@ class HashToXmlTest < Test::Unit::TestCase
def test_two_levels_with_array
xml = { :name => "David", :addresses => [{ :street => "Paulina" }, { :street => "Evergreen" }] }.to_xml(@xml_options)
assert_equal "<person>", xml.first(8)
- assert xml.include?(%(<addresses type="array"><address>))
+ assert xml.include?(%(<addresses><address>))
assert xml.include?(%(<address><street>Paulina</street></address>))
assert xml.include?(%(<address><street>Evergreen</street></address>))
assert xml.include?(%(<name>David</name>))
@@ -378,7 +378,7 @@ class HashToXmlTest < Test::Unit::TestCase
def test_three_levels_with_array
xml = { :name => "David", :addresses => [{ :streets => [ { :name => "Paulina" }, { :name => "Paulina" } ] } ] }.to_xml(@xml_options)
- assert xml.include?(%(<addresses type="array"><address><streets type="array"><street><name>))
+ assert xml.include?(%(<addresses><address><streets><street><name>))
end
def test_single_record_from_xml
@@ -516,41 +516,6 @@ class HashToXmlTest < Test::Unit::TestCase
assert_equal expected_topic_hash, Hash.from_xml(topic_xml)["rsp"]["photos"]["photo"]
end
-
- def test_empty_array_from_xml
- blog_xml = <<-XML
- <blog>
- <posts type="array"></posts>
- </blog>
- XML
- expected_blog_hash = {"blog" => {"posts" => []}}
- assert_equal expected_blog_hash, Hash.from_xml(blog_xml)
- end
-
- def test_array_with_one_entry_from_xml
- blog_xml = <<-XML
- <blog>
- <posts type="array">
- <post>a post</post>
- </posts>
- </blog>
- XML
- expected_blog_hash = {"blog" => {"posts" => ["a post"]}}
- assert_equal expected_blog_hash, Hash.from_xml(blog_xml)
- end
-
- def test_array_with_multiple_entries_from_xml
- blog_xml = <<-XML
- <blog>
- <posts type="array">
- <post>a post</post>
- <post>another post</post>
- </posts>
- </blog>
- XML
- expected_blog_hash = {"blog" => {"posts" => ["a post", "another post"]}}
- assert_equal expected_blog_hash, Hash.from_xml(blog_xml)
- end
def test_xsd_like_types_from_xml
bacon_xml = <<-EOT