change canonical repo to https://github.com/moose/MooseX-Types-Path-Class
[gitmo/MooseX-Types-Path-Class.git] / t / 03.subtype.t
1
2 use warnings FATAL => 'all';
3 use strict;
4
5 use MooseX::Types::Path::Class qw(Dir File);
6 use Moose::Util::TypeConstraints;
7
8 use Test::More;
9
10 plan tests => 4;
11
12 # check that Dir is a subtype of Path::Class::Dir, etc...
13
14 my $tc;
15 $tc = find_type_constraint(Dir);
16 isa_ok( $tc, 'Moose::Meta::TypeConstraint' );
17 ok( $tc->is_subtype_of('Path::Class::Dir'),
18     'Dir is subtype of Path::Class::Dir'
19 );
20 $tc = find_type_constraint(File);
21 isa_ok( $tc, 'Moose::Meta::TypeConstraint' );
22 ok( $tc->is_subtype_of('Path::Class::File'),
23     'File is subtype of Path::Class::File'
24 );
25