X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Faggregate%2Funit_core_path_to.t;fp=t%2Faggregate%2Funit_core_path_to.t;h=a89135c578fca0b2e1c46f9645488e3dbf3ee87a;hb=5d50f369bffa3625ca983b72fc8bc013c8a1e802;hp=0000000000000000000000000000000000000000;hpb=a2aac3b8867dea286d03eba07a6fbe2e237cf1ae;p=catagits%2FCatalyst-Runtime.git diff --git a/t/aggregate/unit_core_path_to.t b/t/aggregate/unit_core_path_to.t new file mode 100644 index 0000000..a89135c --- /dev/null +++ b/t/aggregate/unit_core_path_to.t @@ -0,0 +1,39 @@ +use strict; +use warnings; + +use Test::More; + +my %non_unix = ( + MacOS => 1, + MSWin32 => 1, + os2 => 1, + VMS => 1, + epoc => 1, + NetWare => 1, + dos => 1, + cygwin => 1 +); + +my $os = $non_unix{$^O} ? $^O : 'Unix'; + +if( $os ne 'Unix' ) { + plan skip_all => 'tests require Unix'; +} +else { + plan tests => 3; +} + +use_ok('Catalyst'); + +my $context = 'Catalyst'; + +my $config = Catalyst->config; + +$config->{home} = '/home/sri/my-app/'; + +is( Catalyst::path_to( $context, 'foo' ), '/home/sri/my-app/foo', 'Unix path' ); + +$config->{home} = '/Users/sri/myapp/'; + +is( Catalyst::path_to( $context, 'foo', 'bar' ), + '/Users/sri/myapp/foo/bar', 'deep Unix path' );