X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Funit_utils_subdir.t;h=852d2d42e4456fad51502b83ab811ee1d5df6f1d;hb=8c25d85b1c79a9671c0e81e65c5ff5c112e8399f;hp=8509bea8ab23e673a6726d717ca357e31dd926ba;hpb=69b95ff3efb16d412d4658996fbd722fda411c50;p=catagits%2FCatalyst-Runtime.git diff --git a/t/unit_utils_subdir.t b/t/unit_utils_subdir.t index 8509bea..852d2d4 100644 --- a/t/unit_utils_subdir.t +++ b/t/unit_utils_subdir.t @@ -1,4 +1,4 @@ -use Test::More tests=>7; +use Test::More tests => 8; use strict; use warnings; @@ -9,6 +9,7 @@ use warnings; BEGIN { use_ok 'Catalyst::Utils' } use FindBin; +use Path::Class::Dir; { $INC{'TestApp.pm'} = "$FindBin::Bin/something/script/foo/../../lib/TestApp.pm"; @@ -30,3 +31,14 @@ use FindBin; like($home, qr{t[\/\\]something}, "has path TestApp/t/something"); unlike($home, qr{[\/\\]script[\/\\]foo}, "doesn't have path /script/foo"); } + +{ + $INC{'TestApp.pm'} = "TestApp.pm"; + my $dir = "$FindBin::Bin/something"; + chdir( $dir ); + + my $home = Catalyst::Utils::home('TestApp'); + + $dir = Path::Class::Dir->new( $dir ); + is( $home, "$dir", 'same dir loading' ); +}