6 use MooseX::Types::Path::Class qw( ExistingDir ExistingFile );
28 my $no_exist = '/should/not/exist';
30 plan skip_all => "Preconditions failed; your filesystem is strange"
31 unless -d "/etc" && -e "/etc/passwd";
33 plan skip_all => "Preconditions failed"
36 use MooseX::Types::Path::Class qw(ExistingFile ExistingDir);
38 ok is_ExistingFile(to_ExistingFile("/etc/passwd")), '/etc/passwd is an existing file';
40 ok is_ExistingDir(to_ExistingDir("/etc/")), '/etc/ is an existing directory';
42 throws_ok { Bar->new( dir => $no_exist ); }
43 qr/Directory .* must exist/, 'no exist dir throws';
44 throws_ok { Bar->new( file => "$no_exist/either" ); }
45 qr/File .* must exist/, 'no exist file throws';