stop using excludes within moose, since it's no longer necessary
[gitmo/Moose.git] / t / todo_tests / exception_reflects_failed_constraint.t
1 #!/usr/bin/perl
2
3 # In the case where a child type constraint's parent constraint fails,
4 # the exception should reference the parent type constraint that actually
5 # failed instead of always referencing the child'd type constraint
6
7 use strict;
8 use warnings;
9
10 use Test::More;
11 use Test::Fatal;
12
13 use Moose::Util::TypeConstraints;
14
15 is( exception {
16     subtype 'ParentConstraint' => as 'Str' => where {0};
17 }, undef, 'specified parent type constraint' );
18
19 my $tc;
20 is( exception {
21     $tc = subtype 'ChildConstraint' => as 'ParentConstraint' => where {1};
22 }, undef, 'specified child type constraint' );
23
24 {
25     my $errmsg = $tc->validate();
26
27     TODO: {
28         local $TODO = 'Not yet supported';
29         ok($errmsg !~ /Validation failed for 'ChildConstraint'/, 'exception references failing parent constraint');
30     };
31 }
32
33 done_testing;