changeset 21:c0301992025a draft default tip

Gunzip: tests cleanup.
author Maxim Dounin <mdounin@mdounin.ru>
date Fri, 07 Sep 2012 19:38:56 +0400
parents 1adc6718cc05
children
files t/gunzip.t t/gunzip_memcached.t t/gunzip_perl.t t/gunzip_ssi.t t/gunzip_static.t
diffstat 5 files changed, 16 insertions(+), 36 deletions(-) [+]
line wrap: on
line diff
--- a/t/gunzip.t
+++ b/t/gunzip.t
@@ -20,23 +20,19 @@ select STDOUT; $| = 1;
 eval { require IO::Compress::Gzip; };
 Test::More::plan(skip_all => "IO::Compress::Gzip not found") if $@;
 
-my $t = Test::Nginx->new()->has(qw/http proxy gzip_static/)->plan(13);
+my $t = Test::Nginx->new()->has(qw/http gunzip proxy gzip_static/)->plan(13);
 
 $t->write_file_expand('nginx.conf', <<'EOF');
 
-master_process off;
+%%TEST_GLOBALS%%
+
 daemon         off;
 
 events {
 }
 
 http {
-    access_log    off;
-    root          %%TESTDIR%%;
-
-    client_body_temp_path  %%TESTDIR%%/client_body_temp;
-    fastcgi_temp_path      %%TESTDIR%%/fastcgi_temp;
-    proxy_temp_path        %%TESTDIR%%/proxy_temp;
+    %%TEST_GLOBALS_HTTP%%
 
     server {
         listen       127.0.0.1:8080;
--- a/t/gunzip_memcached.t
+++ b/t/gunzip_memcached.t
@@ -10,10 +10,6 @@ use warnings;
 use strict;
 
 use Test::More;
-
-BEGIN { use FindBin; chdir($FindBin::Bin); }
-
-use lib 'lib';
 use Test::Nginx qw/ :DEFAULT :gzip /;
 
 ###############################################################################
@@ -27,12 +23,12 @@ plan(skip_all => 'Cache::Memcached not i
 eval { require IO::Compress::Gzip; };
 plan(skip_all => "IO::Compress::Gzip not found") if $@;
 
-my $t = Test::Nginx->new()->has(qw/http memcached/)->has_daemon('memcached')
+my $t = Test::Nginx->new()->has(qw/http gunzip memcached/)
+	->has_daemon('memcached')
 	->write_file_expand('nginx.conf', <<'EOF');
 
 %%TEST_GLOBALS%%
 
-master_process off;
 daemon         off;
 
 events {
--- a/t/gunzip_perl.t
+++ b/t/gunzip_perl.t
@@ -10,10 +10,6 @@ use warnings;
 use strict;
 
 use Test::More;
-
-BEGIN { use FindBin; chdir($FindBin::Bin); }
-
-use lib 'lib';
 use Test::Nginx qw/ :DEFAULT :gzip /;
 
 ###############################################################################
@@ -24,12 +20,11 @@ select STDOUT; $| = 1;
 eval { require IO::Compress::Gzip; };
 Test::More::plan(skip_all => "IO::Compress::Gzip not found") if $@;
 
-my $t = Test::Nginx->new()->has(qw/http perl/)->plan(2)
+my $t = Test::Nginx->new()->has(qw/http gunzip perl/)->plan(2)
 	->write_file_expand('nginx.conf', <<'EOF');
 
 %%TEST_GLOBALS%%
 
-master_process off;
 daemon         off;
 
 events {
--- a/t/gunzip_ssi.t
+++ b/t/gunzip_ssi.t
@@ -20,23 +20,20 @@ select STDOUT; $| = 1;
 eval { require IO::Compress::Gzip; };
 Test::More::plan(skip_all => "IO::Compress::Gzip not found") if $@;
 
-my $t = Test::Nginx->new()->has(qw/http ssi proxy gzip_static/)->plan(4);
+my $t = Test::Nginx->new()->has(qw/http gunzip ssi proxy gzip_static/)
+	->plan(4);
 
 $t->write_file_expand('nginx.conf', <<'EOF');
 
-master_process off;
+%%TEST_GLOBALS%%
+
 daemon         off;
 
 events {
 }
 
 http {
-    access_log    off;
-    root          %%TESTDIR%%;
-
-    client_body_temp_path  %%TESTDIR%%/client_body_temp;
-    fastcgi_temp_path      %%TESTDIR%%/fastcgi_temp;
-    proxy_temp_path        %%TESTDIR%%/proxy_temp;
+    %%TEST_GLOBALS_HTTP%%
 
     server {
         listen       127.0.0.1:8080;
--- a/t/gunzip_static.t
+++ b/t/gunzip_static.t
@@ -21,23 +21,19 @@ select STDOUT; $| = 1;
 eval { require IO::Compress::Gzip; };
 Test::More::plan(skip_all => "IO::Compress::Gzip not found") if $@;
 
-my $t = Test::Nginx->new()->has(qw/http proxy gzip_static/);
+my $t = Test::Nginx->new()->has(qw/http gunzip proxy gzip_static/);
 
 $t->write_file_expand('nginx.conf', <<'EOF');
 
-master_process off;
+%%TEST_GLOBALS%%
+
 daemon         off;
 
 events {
 }
 
 http {
-    access_log    off;
-    root          %%TESTDIR%%;
-
-    client_body_temp_path  %%TESTDIR%%/client_body_temp;
-    fastcgi_temp_path      %%TESTDIR%%/fastcgi_temp;
-    proxy_temp_path        %%TESTDIR%%/proxy_temp;
+    %%TEST_GLOBALS_HTTP%%
 
     server {
         listen       127.0.0.1:8080;