changeset 100:9ddc18214854

Tests: arbitrary regexp support in has().
author Maxim Dounin <mdounin@mdounin.ru>
date Thu, 01 Oct 2009 14:28:08 +0400
parents f92852da34aa
children 6303927c18d2
files lib/Test/Nginx.pm
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
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;
 }