File: 05_include_path.t

package info (click to toggle)
libcgi-application-plugin-tt-perl 1.05%2B~cs1.3-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 440 kB
  • sloc: perl: 806; makefile: 17
file content (36 lines) | stat: -rw-r--r-- 842 bytes parent folder | download | duplicates (5)
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
34
35
36
use Test::More;

use lib './t';
use strict;

eval {
  require Class::ISA;
  Class::ISA->import;
};
 
if ($@) {
  plan skip_all => "Class::ISA required for Singleton support";
  exit;
}

plan tests => 5;

$ENV{CGI_APP_RETURN_ONLY} = 1;

use TestAppIncludePath;
$ENV{TT_INCLUDE_PATH} = 't/include1';
my $t1_obj = TestAppIncludePath->new();
my $t1_output = $t1_obj->run();

like($t1_output, qr/include path: t\/include1/, 'include path');
like($t1_output, qr/template dir: include1/, 'template dir');

$ENV{TT_INCLUDE_PATH} = 't/include2';
my $t2_obj = TestAppIncludePath->new();
my $t2_output = $t2_obj->run();

like($t2_output, qr/include path: t\/include2/, 'include path second time');
like($t2_output, qr/template dir: include2/, 'template dir second time');

is_deeply($t1_obj->tt_include_path, [qw[t/include2]],'returns current paths');