1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* test/rexml: Avoid fd leaks.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46178 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
akr 2014-05-27 13:45:04 +00:00
parent 3c908895ab
commit 3356c312cd
11 changed files with 142 additions and 113 deletions

View file

@ -276,7 +276,7 @@ EOF
f.write( tn, Output.new(o = "", "ISO-8859-1") )
assert_equal(expected_iso, o.strip)
doc = Document.new File.new(fixture_path('xmlfile-bug.xml'))
doc = File.open(fixture_path('xmlfile-bug.xml')) {|file| Document.new file }
tn = XPath.first(doc, "//nebenspalte/text()[2]")
assert_equal(expected_utf, tn.to_s.strip)
f.write( tn, Output.new(o = "", "ISO-8859-1") )
@ -310,9 +310,10 @@ EOF
# Alun ap Rhisiart
def test_less_than_in_element_content
source = File.new(fixture_path('ProductionSupport.xml'))
doc = File.open(fixture_path('ProductionSupport.xml')) do |source|
REXML::Document.new source
end
h = Hash.new
doc = REXML::Document.new source
doc.elements.each("//CommonError") { |el|
h[el.elements['Key'].text] = 'okay'
}