aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/xml_mini
diff options
context:
space:
mode:
authorBrian Lopez <seniorlopez@gmail.com>2009-05-17 10:37:30 -0500
committerJoshua Peek <josh@joshpeek.com>2009-05-17 10:37:52 -0500
commit53dda29f8b34073a4b135ee224c1d09c1f10de02 (patch)
tree4046b55b7609e20c6ef4cc8732724b774b997bf8 /activesupport/test/xml_mini
parent344ee681d6a89ea1da71c39e75c29e0cbda44914 (diff)
downloadrails-53dda29f8b34073a4b135ee224c1d09c1f10de02.tar.gz
rails-53dda29f8b34073a4b135ee224c1d09c1f10de02.tar.bz2
rails-53dda29f8b34073a4b135ee224c1d09c1f10de02.zip
Add support for parsing XML and JSON from an IO as well as a string [#2659 state:resolved]
Signed-off-by: Joshua Peek <josh@joshpeek.com>
Diffstat (limited to 'activesupport/test/xml_mini')
-rw-r--r--activesupport/test/xml_mini/nokogiri_engine_test.rb13
-rw-r--r--activesupport/test/xml_mini/rexml_engine_test.rb14
2 files changed, 27 insertions, 0 deletions
diff --git a/activesupport/test/xml_mini/nokogiri_engine_test.rb b/activesupport/test/xml_mini/nokogiri_engine_test.rb
index 886a9d1aba..7c3a591e63 100644
--- a/activesupport/test/xml_mini/nokogiri_engine_test.rb
+++ b/activesupport/test/xml_mini/nokogiri_engine_test.rb
@@ -148,6 +148,19 @@ class NokogiriEngineTest < Test::Unit::TestCase
eoxml
end
+ def test_parse_from_io
+ io = StringIO.new(<<-eoxml)
+ <root>
+ good
+ <products>
+ hello everyone
+ </products>
+ morning
+ </root>
+ eoxml
+ XmlMini.parse(io)
+ end
+
private
def assert_equal_rexml(xml)
hash = XmlMini.with_backend('REXML') { XmlMini.parse(xml) }
diff --git a/activesupport/test/xml_mini/rexml_engine_test.rb b/activesupport/test/xml_mini/rexml_engine_test.rb
index a412d8ca05..57bb35254a 100644
--- a/activesupport/test/xml_mini/rexml_engine_test.rb
+++ b/activesupport/test/xml_mini/rexml_engine_test.rb
@@ -12,4 +12,18 @@ class REXMLEngineTest < Test::Unit::TestCase
XmlMini.backend = 'REXML'
assert_equal XmlMini_REXML, XmlMini.backend
end
+
+ def test_parse_from_io
+ XmlMini.backend = 'REXML'
+ io = StringIO.new(<<-eoxml)
+ <root>
+ good
+ <products>
+ hello everyone
+ </products>
+ morning
+ </root>
+ eoxml
+ XmlMini.parse(io)
+ end
end