2009-03-10 00:27:39 +00:00
|
|
|
require 'abstract_unit'
|
|
|
|
require 'active_support/xml_mini'
|
|
|
|
|
2012-01-06 01:12:46 +00:00
|
|
|
class REXMLEngineTest < ActiveSupport::TestCase
|
2009-03-10 00:27:39 +00:00
|
|
|
include ActiveSupport
|
|
|
|
|
|
|
|
def test_default_is_rexml
|
|
|
|
assert_equal XmlMini_REXML, XmlMini.backend
|
|
|
|
end
|
|
|
|
|
|
|
|
def test_set_rexml_as_backend
|
|
|
|
XmlMini.backend = 'REXML'
|
|
|
|
assert_equal XmlMini_REXML, XmlMini.backend
|
|
|
|
end
|
2009-05-17 15:37:30 +00:00
|
|
|
|
|
|
|
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
|
2009-03-10 00:27:39 +00:00
|
|
|
end
|