9 use MooX::Types::MooseLike::Base qw(Str);
10 use MooX::Types::MooseLike::Numeric qw(PositiveInt);
17 has named_external_type => (
22 package TypeOMatic::Consumer;
24 # do this as late as possible to simulate "real" behaviour
30 my $meta = Class::MOP::class_of('TypeOMatic::Consumer');
32 my ($str, $positive_int)
33 = map $meta->get_attribute($_)->type_constraint->name,
34 qw(named_type named_external_type);
36 is($str, 'Str', 'Built-in Moose type ok');
38 $positive_int, 'MooseX::Types::Common::Numeric::PositiveInt',
39 'External (MooseX::Types type) ok'
47 $Moo::HandleMoose::TYPE_MAP{$isa} = sub { $isa };
48 has barble => (is => "ro", isa => $isa);
49 __PACKAGE__->meta->get_attribute("barble");
54 qr/^error inflating attribute 'barble' for package 'Fooble': \$TYPE_MAP\{CODE\(\w+?\)\} did not return a valid type constraint/,
55 'error message for incorrect type constraint inflation',