X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=blobdiff_plain;f=t%2Faggregate%2Funit_core_path_to.t;h=b93faa854250ce03508915df5b16364cc00a53ed;hp=f4fe89f5ff662bb1a89bd8d12f2cb21f746d813c;hb=10542b5178b2fa036e0658111523ea68a7a04437;hpb=0891873bd40ef6164f42674000fb663f0d223f68 diff --git a/t/aggregate/unit_core_path_to.t b/t/aggregate/unit_core_path_to.t index f4fe89f..b93faa8 100644 --- a/t/aggregate/unit_core_path_to.t +++ b/t/aggregate/unit_core_path_to.t @@ -5,6 +5,11 @@ use Test::More; use FindBin; use Path::Class; use File::Basename; +BEGIN { + delete $ENV{CATALYST_HOME}; # otherwise it'll set itself up to the wrong place +} +use lib "$FindBin::Bin/../lib"; +use TestApp; my %non_unix = ( MacOS => 1, @@ -25,23 +30,16 @@ if ( $os ne 'Unix' ) { use_ok('Catalyst'); -my $context = 'Catalyst'; - -$context->setup_home; -my $base = dir($FindBin::Bin)->relative->stringify; +my $context = 'TestApp'; +my $base; -isa_ok( Catalyst::path_to( $context, $base ), 'Path::Class::Dir' ); -isa_ok( Catalyst::path_to( $context, $base, basename $0 ), 'Path::Class::File' ); +isa_ok( $base = Catalyst::path_to( $context, '' ), 'Path::Class::Dir' ); my $config = Catalyst->config; -$config->{home} = '/home/sri/my-app/'; - -is( Catalyst::path_to( $context, 'foo' ), '/home/sri/my-app/foo', 'Unix path' ); - -$config->{home} = '/Users/sri/myapp/'; +is( Catalyst::path_to( $context, 'foo' ), "$base/foo", 'Unix path' ); is( Catalyst::path_to( $context, 'foo', 'bar' ), - '/Users/sri/myapp/foo/bar', 'deep Unix path' ); + "$base/foo/bar", 'deep Unix path' ); done_testing;