more fixes to the tests
[gitmo/MooseX-Dependent.git] / t / 01-dependent.t
1
2 use Test::More tests=>5; {
3         
4         use strict;
5         use warnings;
6         
7         use MooseX::Dependent::Types qw(Dependent);
8         use MooseX::Types -declare=>[qw(SubDependent)];
9         use Moose::Util::TypeConstraints;
10
11         ok subtype( SubDependent, as Dependent ),
12           'Create a useless subtype';
13         ok Dependent->check(1),
14           'Dependent is basically an Any';
15         ok SubDependent->check(1),
16           'SubDependent is basically an Any';
17         is Dependent->parent, 'Any',
18           'Dependent is an Any';
19         is SubDependent->parent, 'MooseX::Dependent::Types::Dependent',
20           'SubDependent is a Dependent';
21         is Dependent->get_message, "Validation failed for 'MooseX::Dependent::Types::Dependent' failed with value undef",
22           'Got Expected Message'
23         warn SubDependent->get_message;
24 }
25
26 __END__
27
28 check
29 validate
30 get_message
31 name
32 equals
33 is_a_type_of
34 is_subtype_of