File: 10ignore_dirs.t

package info (click to toggle)
libcatalyst-plugin-static-simple-perl 0.36-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster
  • size: 384 kB
  • sloc: perl: 2,629; makefile: 2
file content (28 lines) | stat: -rw-r--r-- 842 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!perl

use strict;
use warnings;

use FindBin;
use lib "$FindBin::Bin/lib";

use Test::More tests => 6;
use Catalyst::Test 'TestApp';

# test ignoring directories
TestApp->config->{'Plugin::Static::Simple'}->{ignore_dirs} = [ qw/ignored o-ignored files/ ];

# test altenate root dirs
TestApp->config->{'Plugin::Static::Simple'}->{include_path} = [
    TestApp->config->{root} . '/overlay',
    TestApp->config->{root},
];

ok( my $res = request('http://localhost/ignored/bad.gif'), 'request ok' );
is( $res->content, 'default', 'ignored directory `ignored` ok' );

ok( $res = request('http://localhost/files/static.css'), 'request ok' );
is( $res->content, 'default', 'ignored directory `files` ok' );

ok( $res = request('http://localhost/o-ignored/bad.gif'), 'request ok' );
is( $res->content, 'default', 'ignored overlay directory ok' );