Rewind StringIO instances before be parsed again

This commit is contained in:
Paco Guzman 2013-06-16 00:32:33 +02:00
parent e04d9538ea
commit 20bd16330c
5 changed files with 5 additions and 0 deletions

View File

@ -195,6 +195,7 @@ class LibxmlEngineTest < ActiveSupport::TestCase
private
def assert_equal_rexml(xml)
parsed_xml = XmlMini.parse(xml)
xml.rewind if xml.respond_to?(:rewind)
hash = XmlMini.with_backend('REXML') { XmlMini.parse(xml) }
assert_equal(hash, parsed_xml)
end

View File

@ -186,6 +186,7 @@ class LibXMLSAXEngineTest < ActiveSupport::TestCase
private
def assert_equal_rexml(xml)
parsed_xml = XmlMini.parse(xml)
xml.rewind if xml.respond_to?(:rewind)
hash = XmlMini.with_backend('REXML') { XmlMini.parse(xml) }
assert_equal(hash, parsed_xml)
end

View File

@ -208,6 +208,7 @@ class NokogiriEngineTest < ActiveSupport::TestCase
private
def assert_equal_rexml(xml)
parsed_xml = XmlMini.parse(xml)
xml.rewind if xml.respond_to?(:rewind)
hash = XmlMini.with_backend('REXML') { XmlMini.parse(xml) }
assert_equal(hash, parsed_xml)
end

View File

@ -209,6 +209,7 @@ class NokogiriSAXEngineTest < ActiveSupport::TestCase
private
def assert_equal_rexml(xml)
parsed_xml = XmlMini.parse(xml)
xml.rewind if xml.respond_to?(:rewind)
hash = XmlMini.with_backend('REXML') { XmlMini.parse(xml) }
assert_equal(hash, parsed_xml)
end

View File

@ -30,6 +30,7 @@ class REXMLEngineTest < ActiveSupport::TestCase
private
def assert_equal_rexml(xml)
parsed_xml = XmlMini.parse(xml)
xml.rewind if xml.respond_to?(:rewind)
hash = XmlMini.with_backend('REXML') { XmlMini.parse(xml) }
assert_equal(hash, parsed_xml)
end