diff proxy_cookie.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 0ca8725e5958
children 847ea345becb
line wrap: on
line diff
--- a/proxy_cookie.t
+++ b/proxy_cookie.t
@@ -73,14 +73,7 @@ http {
 
 EOF
 
-eval {
-	open OLDERR, ">&", \*STDERR; close STDERR;
-	$t->run();
-	open STDERR, ">&", \*OLDERR;
-};
-plan(skip_all => 'no proxy_cookie') if $@;
-
-$t->plan(8);
+$t->try_run('no proxy_cookie')->plan(8);
 
 ###############################################################################