Skip to content
Browse files

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.

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.
  • Loading branch information...
mame committed Nov 8, 2019
1 parent 88b9a0f commit 9deca1a3b91271159e164188367f003978737f42
Showing with 8 additions and 0 deletions.
  1. +8 −0 spec/ruby/security/cve_2018_6914_spec.rb
@@ -9,6 +9,14 @@
@dir = tmp("CVE-2018-6914")
ENV['TMPDIR'] = @dir

# Make sure that ENV["TMPDIR"] is used by Dir.tmpdir
10.times do
break if Dir.tmpdir == File.expand_path(@dir)
sleep 0.1

@dir << '/'

@tempfile = nil

0 comments on commit 9deca1a

Please sign in to comment.
You can’t perform that action at this time.