Mercurial > hg > ngx_http_catch_body_filter_module
comparison t/catch_body.t @ 4:01a36878bf36
Tests now use try_run().
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Mon, 09 Feb 2015 19:57:51 +0300 |
parents | 04788ce8dae7 |
children |
comparison
equal
deleted
inserted
replaced
3:d7b8639a8857 | 4:01a36878bf36 |
---|---|
17 ############################################################################### | 17 ############################################################################### |
18 | 18 |
19 select STDERR; $| = 1; | 19 select STDERR; $| = 1; |
20 select STDOUT; $| = 1; | 20 select STDOUT; $| = 1; |
21 | 21 |
22 my $t = Test::Nginx->new()->has(qw/http proxy rewrite/)->plan(6) | 22 my $t = Test::Nginx->new()->has(qw/http proxy rewrite/) |
23 ->write_file_expand('nginx.conf', <<'EOF'); | 23 ->write_file_expand('nginx.conf', <<'EOF'); |
24 | 24 |
25 %%TEST_GLOBALS%% | 25 %%TEST_GLOBALS%% |
26 | 26 |
27 daemon off; | 27 daemon off; |
46 } | 46 } |
47 | 47 |
48 EOF | 48 EOF |
49 | 49 |
50 $t->write_file('index.html', 'SEE-THIS'); | 50 $t->write_file('index.html', 'SEE-THIS'); |
51 $t->run(); | 51 $t->try_run('no catch_body')->plan(6); |
52 | 52 |
53 ############################################################################### | 53 ############################################################################### |
54 | 54 |
55 like(get_body('/', '123456'), qr/200 OK/, 'normal'); | 55 like(get_body('/', '123456'), qr/200 OK/, 'normal'); |
56 like(get_body('/', '12345X'), qr/403 Forbidden/, 'rejected'); | 56 like(get_body('/', '12345X'), qr/403 Forbidden/, 'rejected'); |