more fixes to the tests
[gitmo/MooseX-Dependent.git] / t / 01-dependent.t
CommitLineData
a588ee00 1
1e87d1a7 2use Test::More tests=>5; {
a588ee00 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
1e87d1a7 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;
a588ee00 24}
1e87d1a7 25
26__END__
27
28check
29validate
30get_message
31name
32equals
33is_a_type_of
34is_subtype_of