File: psgi_file_testapp.t

package info (click to toggle)
libcatalyst-perl 5.90132-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,016 kB
  • sloc: perl: 11,061; makefile: 7
file content (33 lines) | stat: -rw-r--r-- 576 bytes parent folder | download | duplicates (7)
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
29
30
31
32
33
use strict;
use warnings;
no warnings 'once';
use FindBin qw/$Bin/;
use lib "$Bin/lib";

use Test::More;

use File::Spec;
use File::Temp qw/ tempdir /;

my $temp;
BEGIN {
    $temp = tempdir( CLEANUP => 1 );

    $ENV{CATALYST_HOME} = $temp;
    open(my $psgi, '>', File::Spec->catfile($temp, 'testapp.psgi')) or die;
    print $psgi q{
        use strict;
        use TestApp;

        $main::have_loaded_psgi = 1;
        my $app = TestApp->psgi_app;
    };
    close($psgi);
}
use Catalyst::Test qw/ TestApp /;

ok request('/');
ok $main::have_loaded_psgi;

done_testing;