diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/helper.rb | 8 | ||||
-rw-r--r-- | test/test_client_expire.rb | 2 |
2 files changed, 10 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) diff --git a/test/test_client_expire.rb b/test/test_client_expire.rb index 6436c7c..bdf0cb4 100644 --- a/test/test_client_expire.rb +++ b/test/test_client_expire.rb @@ -32,6 +32,7 @@ class TestClientExpire < Testcase end def test_client_expire + require_exec "ab" nr = 32 err = @err cfg = Yahns::Config.new @@ -74,6 +75,7 @@ class TestClientExpire < Testcase # test EMFILE handling def test_client_expire_desperate + require_exec "ab" err = @err cfg = Yahns::Config.new host, port = @srv.addr[3], @srv.addr[1] |