5.7xxx xxx
- Get some of the optional_* tests working from dirs with spaces (RT #26455)
+ - Fix Catalyst::Utils::home() when application .pm is in the current dir (RT #34437)
5.7014 2008-05-25 15:26:00
- Addition of .conf in restart regex in Catalyst::Engine::HTTP::Restarter::Watcher
use URI;
use Class::Inspector;
use Carp qw/croak/;
+use Cwd;
=head1 NAME
# find the @INC entry in which $file was found
(my $path = $inc_entry) =~ s/$file$//;
+ $path ||= cwd() if !defined $path || !length $path;
my $home = dir($path)->absolute->cleanup;
# pop off /lib and /blib if they're there
-use Test::More tests=>7;
+use Test::More tests => 8;
use strict;
use warnings;
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');
+
+ is( $home, $dir, 'same dir loading' );
+}