File: unit_core_path_to.t

package info (click to toggle)
libcatalyst-perl 5.7014-1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 1,276 kB
  • ctags: 874
  • sloc: perl: 11,270; makefile: 48
file content (39 lines) | stat: -rw-r--r-- 691 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
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' );