mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Try to fix test-spec failure on macOS
Not sure what is happening, but spec/ruby/security/cve_2018_6914_spec.rb
fails on macOS.
294462511 (step)
:10:134
I suspect that the state of a directory is weird immediately after it is
created (not writable or even world writable?). This change tries to
make sure that ENV["TMPDIR"] is actually used by Dir.tmpdir.
This commit is contained in:
parent
88b9a0f7fe
commit
9deca1a3b9
1 changed files with 8 additions and 0 deletions
|
@ -9,6 +9,14 @@ describe "CVE-2018-6914 is resisted by" do
|
|||
@dir = tmp("CVE-2018-6914")
|
||||
Dir.mkdir(@dir)
|
||||
ENV['TMPDIR'] = @dir
|
||||
|
||||
# Make sure that ENV["TMPDIR"] is used by Dir.tmpdir
|
||||
# https://github.com/ruby/ruby/runs/294462511#step:10:134
|
||||
10.times do
|
||||
break if Dir.tmpdir == File.expand_path(@dir)
|
||||
sleep 0.1
|
||||
end
|
||||
|
||||
@dir << '/'
|
||||
|
||||
@tempfile = nil
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue