diff proxy_cache_lock.t @ 392:c28ecaef065f

Tests: try_run() introduced. This method replaces multiple ad-hoc solutions to grecefully skip tests if nginx startup fails, e.g., due to no support for a particular directive.
author Maxim Dounin <mdounin@mdounin.ru>
date Fri, 18 Apr 2014 18:36:26 +0400
parents 6a0d934950bc
children 847ea345becb
line wrap: on
line diff
--- a/proxy_cache_lock.t
+++ b/proxy_cache_lock.t
@@ -70,14 +70,8 @@ EOF
 
 $t->run_daemon(\&http_fake_daemon);
 
-eval {
-	open OLDERR, ">&", \*STDERR; close STDERR;
-	$t->run();
-	open STDERR, ">&", \*OLDERR;
-};
-plan(skip_all => 'no proxy_cache_lock') if $@;
+$t->try_run('no proxy_cache_lock')->plan(19);
 
-$t->plan(19);
 $t->waitforsocket('127.0.0.1:8081');
 
 ###############################################################################