1 use Test::More tests => 8;
6 # simulates an entire testapp rooted at t/something
7 # except without bothering creating it since it's
8 # only the -e check on the Makefile.PL that matters
10 BEGIN { use_ok 'Catalyst::Utils' }
15 $INC{'TestApp.pm'} = "$FindBin::Bin/something/script/foo/../../lib/TestApp.pm";
16 my $home = Catalyst::Utils::home('TestApp');
17 like($home, qr{t[\/\\]something}, "has path TestApp/t/something");
18 unlike($home, qr{[\/\\]script[\/\\]foo}, "doesn't have path /script/foo");
22 $INC{'TestApp.pm'} = "$FindBin::Bin/something/script/foo/bar/../../../lib/TestApp.pm";
23 my $home = Catalyst::Utils::home('TestApp');
24 like($home, qr{t[\/\\]something}, "has path TestApp/t/something");
25 unlike($home, qr{[\/\\]script[\/\\]foo[\/\\]bar}, "doesn't have path /script/foo/bar");
29 $INC{'TestApp.pm'} = "$FindBin::Bin/something/script/../lib/TestApp.pm";
30 my $home = Catalyst::Utils::home('TestApp');
31 like($home, qr{t[\/\\]something}, "has path TestApp/t/something");
32 unlike($home, qr{[\/\\]script[\/\\]foo}, "doesn't have path /script/foo");
36 $INC{'TestApp.pm'} = "TestApp.pm";
37 my $dir = "$FindBin::Bin/something";
40 my $home = Catalyst::Utils::home('TestApp');
42 $dir = Path::Class::Dir->new( $dir );
43 is( $home, "$dir", 'same dir loading' );