use inlined module hiding in tests
[catagits/Catalyst-Runtime.git] / t / aggregate / unit_core_path_to.t
1 use strict;
2 use warnings;
3
4 use Test::More;
5 use FindBin;
6 use Path::Class;
7 use File::Basename;
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;
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
27 if ( $os ne 'Unix' ) {
28     plan skip_all => 'tests require Unix';
29 }
30
31 use_ok('Catalyst');
32
33 my $context = 'TestApp';
34 my $base;
35
36 isa_ok( $base = Catalyst::path_to( $context, '' ), 'Path::Class::Dir' );
37
38 my $config = Catalyst->config;
39
40 is( Catalyst::path_to( $context, 'foo' ), "$base/foo", 'Unix path' );
41
42 is( Catalyst::path_to( $context, 'foo', 'bar' ),
43     "$base/foo/bar", 'deep Unix path' );
44
45 done_testing;