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
This commit is contained in:
normal 2018-07-11 08:33:32 +00:00
Родитель 3e93bf3b46
Коммит 9366d7092f
1 изменённых файлов: 12 добавлений и 9 удалений

Просмотреть файл

@ -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