Commit | Line | Data |
01033d73 |
1 | use strict; |
2 | use warnings; |
3 | |
5b19d407 |
4 | use Test::More; |
0891873b |
5 | use FindBin; |
6 | use Path::Class; |
7 | use File::Basename; |
78da9e75 |
8 | BEGIN { |
9 | delete $ENV{CATALYST_HOME}; # otherwise it'll set itself up to the wrong place |
10 | } |
11 | use lib "$FindBin::Bin/../lib"; |
12 | use TestApp; |
01033d73 |
13 | |
14 | my %non_unix = ( |
15 | MacOS => 1, |
16 | MSWin32 => 1, |
17 | os2 => 1, |
18 | VMS => 1, |
19 | epoc => 1, |
20 | NetWare => 1, |
21 | dos => 1, |
22 | cygwin => 1 |
23 | ); |
24 | |
25 | my $os = $non_unix{$^O} ? $^O : 'Unix'; |
26 | |
0891873b |
27 | if ( $os ne 'Unix' ) { |
c7ded7aa |
28 | plan skip_all => 'tests require Unix'; |
5b19d407 |
29 | } |
01033d73 |
30 | |
01033d73 |
31 | use_ok('Catalyst'); |
32 | |
78da9e75 |
33 | my $context = 'TestApp'; |
34 | my $base; |
0891873b |
35 | |
78da9e75 |
36 | isa_ok( $base = Catalyst::path_to( $context, '' ), 'Path::Class::Dir' ); |
0891873b |
37 | |
fa32ac82 |
38 | my $config = Catalyst->config; |
39 | |
78da9e75 |
40 | is( Catalyst::path_to( $context, 'foo' ), "$base/foo", 'Unix path' ); |
01033d73 |
41 | |
42 | is( Catalyst::path_to( $context, 'foo', 'bar' ), |
78da9e75 |
43 | "$base/foo/bar", 'deep Unix path' ); |
0891873b |
44 | |
45 | done_testing; |