diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-05-27 13:45:04 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-05-27 13:45:04 +0000 |
commit | 3356c312cddcc95af59e648c4ad946ec969d9813 (patch) | |
tree | 5e6ba12c41b94d5288f38cd60a913244288ddc34 /test/rexml/test_lightparser.rb | |
parent | 3c908895abe6c6f113ae9776480cff983a6cd4bb (diff) | |
download | ruby-3356c312cddcc95af59e648c4ad946ec969d9813.tar.gz |
* test/rexml: Avoid fd leaks.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46178 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/rexml/test_lightparser.rb')
-rw-r--r-- | test/rexml/test_lightparser.rb | 7 |
1 files changed, 4 insertions, 3 deletions
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 |