Fix locating t/lib
[catagits/Catalyst-Runtime.git] / t / unit_utils_subdir.t
index 8509bea..852d2d4 100644 (file)
@@ -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' );
+}