diff lib/Test/Nginx.pm @ 100:9ddc18214854

Tests: arbitrary regexp support in has().
author Maxim Dounin <mdounin@mdounin.ru>
date Thu, 01 Oct 2009 14:28:08 +0400
parents ecff5407867c
children 8bc9de6559a1
line wrap: on
line diff
--- a/lib/Test/Nginx.pm
+++ b/lib/Test/Nginx.pm
@@ -60,8 +60,11 @@ sub has {
 		rewrite	=> '(?s)^(?!.*--without-http_rewrite_module)',
 	);
 
+	my $re = $regex{$feature};
+	$re = $feature if !defined $re;
+
 	Test::More::plan(skip_all => "$feature not compiled in")
-		unless `$NGINX -V 2>&1` =~ $regex{$feature};
+		unless `$NGINX -V 2>&1` =~ $re;
 
 	return $self;
 }