diff gunzip_static.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/gunzip_static.t
+++ b/gunzip_static.t
@@ -74,14 +74,7 @@ IO::Compress::Gzip::gzip(\$in => \$out);
 $t->write_file('t2.gz', $out . $out);
 $t->write_file('t3', 'not compressed');
 
-eval {
-	open OLDERR, ">&", \*STDERR; close STDERR;
-	$t->run();
-	open STDERR, ">&", \*OLDERR;
-};
-plan(skip_all => 'no gzip_static always') if $@;
-
-$t->plan(12);
+$t->try_run('no gzip_static always')->plan(12);
 
 ###############################################################################