From 3356c312cddcc95af59e648c4ad946ec969d9813 Mon Sep 17 00:00:00 2001 From: akr Date: Tue, 27 May 2014 13:45:04 +0000 Subject: * test/rexml: Avoid fd leaks. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46178 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/rexml/test_lightparser.rb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'test/rexml/test_lightparser.rb') diff --git a/test/rexml/test_lightparser.rb b/test/rexml/test_lightparser.rb index 4aa465b9fa..f8212dcd2e 100644 --- a/test/rexml/test_lightparser.rb +++ b/test/rexml/test_lightparser.rb @@ -6,9 +6,10 @@ module REXMLTests include REXMLTestUtils include REXML def test_parsing - f = File.new(fixture_path("documentation.xml")) - parser = REXML::Parsers::LightParser.new( f ) - parser.parse + File.open(fixture_path("documentation.xml")) do |f| + parser = REXML::Parsers::LightParser.new( f ) + parser.parse + end end end end -- cgit v1.2.3