Skip to content

Commit

Permalink
File.umask does not make sense on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
nobu authored and andrykonchin committed Jul 1, 2024
1 parent 0f4ce96 commit 1045067
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/mspec/helpers/tmp.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,11 @@ def tmp(name, uniquify = true)
raise ArgumentError, "SPEC_TEMP_DIR (#{SPEC_TEMP_DIR}) is world writable but not sticky"
end
else
umask = File.umask
if (umask & 0002) == 0 # o+w
raise ArgumentError, "File.umask #=> #{umask.to_s(8)} (world-writable)"
platform_is_not :windows do
umask = File.umask
if (umask & 0002) == 0 # o+w
raise ArgumentError, "File.umask #=> #{umask.to_s(8)} (world-writable)"
end
end
mkdir_p SPEC_TEMP_DIR
end
Expand Down

0 comments on commit 1045067

Please sign in to comment.