Mercurial > hg > nginx-tests
diff proxy_cache_revalidate.t @ 467:43e05ac6c23c
Tests: the read_file function added in Test::Nginx.
author | Sergey Kandaurov <pluknet@nginx.com> |
---|---|
date | Mon, 22 Sep 2014 13:30:04 +0400 |
parents | f620d9529ed6 |
children | 9a6e0ede4b92 |
line wrap: on
line diff
--- a/proxy_cache_revalidate.t +++ b/proxy_cache_revalidate.t @@ -102,7 +102,7 @@ like(http_get('/t'), qr/X-Cache-Status: like(http_get('/t'), qr/X-Cache-Status: HIT.*SEE/ms, 'cached again'); select undef, undef, undef, 0.1; -like(read_file($t->testdir() . '/access.log'), qr/ 304 /, 'not modified'); +like($t->read_file('access.log'), qr/ 304 /, 'not modified'); # 2nd document is recreated with a new content @@ -130,18 +130,3 @@ like(http_get('/etag/t2'), qr/X-Cache-St 'etag2 new response cached'); ############################################################################### - -sub read_file { - my ($file) = @_; - my $log; - - local $/; - - open LOG, $file or die "Can't open $file: $!\n"; - $log = <LOG>; - close LOG; - - return $log; -} - -###############################################################################