1 use Test::More tests=>7;
6 # simulates an entire testapp rooted at t/something
7 # except without bothering creating it since its
8 # only the -e check on the Makefile.PL that matters
10 BEGIN { use_ok 'Catalyst::Utils' }
13 $INC{'TestApp.pm'} = "$FindBin::Bin/something/script/foo/../../lib/TestApp.pm";
14 my $home = Catalyst::Utils::home('TestApp');
15 like($home, qr/t\/something/, "has path TestApp/t/something");
16 unlike($home, qr/\/script\/foo/, "doesn't have path /script/foo");
18 $INC{'TestApp.pm'} = "$FindBin::Bin/something/script/foo/bar/../../../lib/TestApp.pm";
19 $home = Catalyst::Utils::home('TestApp');
20 like($home, qr/t\/something/, "has path TestApp/t/something");
21 unlike($home, qr/\/script\/foo\/bar/, "doesn't have path /script/foo");
23 $INC{'TestApp.pm'} = "$FindBin::Bin/something/script/../lib/TestApp.pm";
24 $home = Catalyst::Utils::home('TestApp');
25 like($home, qr/t\/something/, "has path TestApp/t/something");
26 unlike($home, qr/\/script\/foo/, "doesn't have path /script/foo");