diff options
author | Eric Wong <e@80x24.org> | 2013-12-27 23:50:01 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2013-12-27 23:50:01 +0000 |
commit | 4fe625b9a42b003e31329edd45d087b9c47ef5ed (patch) | |
tree | cebd74bf737d710f11eef92197405c32780273c1 /test/helper.rb | |
parent | 9a3d58a96b32b50000e590d4432e8e2031ee7b82 (diff) | |
download | yahns-4fe625b9a42b003e31329edd45d087b9c47ef5ed.tar.gz |
ab(1) is less common than our other dependencies, so allow tests to run without it.
Diffstat (limited to 'test/helper.rb')
-rw-r--r-- | test/helper.rb | 8 |
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) |