aboutsummaryrefslogtreecommitdiffstats
path: root/tests/common.rb
diff options
context:
space:
mode:
Diffstat (limited to 'tests/common.rb')
-rwxr-xr-xtests/common.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/common.rb b/tests/common.rb
index 5701123..518aab2 100755
--- a/tests/common.rb
+++ b/tests/common.rb
@@ -66,6 +66,15 @@ def wait_for(options = {}, &condition)
true
end
+def with_umask(umask, &block)
+ old_umask = File.umask(umask)
+ begin
+ block.call
+ ensure
+ File.umask(old_umask)
+ end
+end
+
def valgrind_options
opt = ARGV.find {|s| s.start_with?('--valgrind') }
if opt == nil