From 1045067accc337c1ae604c1d15ecc58d1ef46367 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Wed, 12 Jun 2024 14:46:29 +0900 Subject: [PATCH] `File.umask` does not make sense on Windows --- lib/mspec/helpers/tmp.rb | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/mspec/helpers/tmp.rb b/lib/mspec/helpers/tmp.rb index 437261a..e903dd9 100644 --- a/lib/mspec/helpers/tmp.rb +++ b/lib/mspec/helpers/tmp.rb @@ -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