# HG changeset patch # User Maxim Dounin # Date 1347032336 -14400 # Node ID c0301992025a04cf9bbd98ba9420624f0009e46e # Parent 1adc6718cc058e12d3ad7984ba47fc864737a158 Gunzip: tests cleanup. diff --git a/t/gunzip.t b/t/gunzip.t --- 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; diff --git a/t/gunzip_memcached.t b/t/gunzip_memcached.t --- 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 { diff --git a/t/gunzip_perl.t b/t/gunzip_perl.t --- 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 { diff --git a/t/gunzip_ssi.t b/t/gunzip_ssi.t --- 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; diff --git a/t/gunzip_static.t b/t/gunzip_static.t --- 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;