6 use Test
::More tests
=> 5;
13 my $query = CGI
->new();
15 my $output = 'foobarbaz';
20 open STDOUT
, '>', \
$stdout;
21 output_html_with_http_headers
$query, $cookie, $output, undef, { force_no_caching
=> 1 };
22 like
($stdout, qr/Cache-control: no-cache, no-store, max-age=0/, 'force_no_caching sets Cache-control as desired');
23 like
($stdout, qr/Expires: /, 'force_no_caching sets an Expires header');
26 open STDOUT
, '>', \
$stdout;
27 output_html_with_http_headers
$query, $cookie, $output, undef, undef;
28 like
($stdout, qr/Cache-control: no-cache[^,]/, 'not using force_no_caching sets Cache-control as desired');
29 unlike
($stdout, qr/Expires: /, 'force_no_caching does not set an Expires header');