From 9366d7092f824aeae555f80c9afa645e59822b54 Mon Sep 17 00:00:00 2001 From: normal Date: Wed, 11 Jul 2018 08:33:32 +0000 Subject: spec/ruby/security/cve_2018_6914_spec.rb: get rid of leftover files I ran out of inodes in $TMPDIR :< git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63946 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- spec/ruby/security/cve_2018_6914_spec.rb | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/spec/ruby/security/cve_2018_6914_spec.rb b/spec/ruby/security/cve_2018_6914_spec.rb index 1837ca0cef..a40225799d 100644 --- a/spec/ruby/security/cve_2018_6914_spec.rb +++ b/spec/ruby/security/cve_2018_6914_spec.rb @@ -32,22 +32,25 @@ describe "CVE-2018-6914 is resisted by" do it "Tempfile.create by deleting separators" do expect = Dir.glob(@traversal_path + '*').count - Tempfile.create(@traversal_path + 'foo') - actual = Dir.glob(@traversal_path + '*').count - actual.should == expect + Tempfile.create(@traversal_path + 'foo') do + actual = Dir.glob(@traversal_path + '*').count + actual.should == expect + end end it "Dir.mktmpdir by deleting separators" do expect = Dir.glob(@traversal_path + '*').count - Dir.mktmpdir(@traversal_path + 'foo') - actual = Dir.glob(@traversal_path + '*').count - actual.should == expect + Dir.mktmpdir(@traversal_path + 'foo') do + actual = Dir.glob(@traversal_path + '*').count + actual.should == expect + end end it "Dir.mktmpdir with an array by deleting separators" do expect = Dir.glob(@traversal_path + '*').count - Dir.mktmpdir([@traversal_path, 'foo']) - actual = Dir.glob(@traversal_path + '*').count - actual.should == expect + Dir.mktmpdir([@traversal_path, 'foo']) do + actual = Dir.glob(@traversal_path + '*').count + actual.should == expect + end end end -- cgit v1.2.3