about summary refs log tree commit homepage
path: root/test/helper.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/helper.rb')
-rw-r--r--test/helper.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/helper.rb b/test/helper.rb
index ae22e7f..a841f20 100644
--- a/test/helper.rb
+++ b/test/helper.rb
@@ -119,6 +119,14 @@ def cloexec_pipe
   IO.pipe.each { |io| io.close_on_exec = true }
 end
 
+def require_exec(cmd)
+  ENV["PATH"].split(/:/).each do |path|
+    return true if File.executable?("#{path}/#{cmd}")
+  end
+  skip "#{cmd} not found in PATH"
+  false
+end
+
 require 'yahns'
 
 # needed for parallel (MT) tests)