Regenerate test files
[gitmo/Mouse.git] / t / 040_type_constraints / 031_subtype_auto_vivify_parent.t
CommitLineData
b2b106d7 1#!/usr/bin/perl
fde8e43f 2# This is automatically generated by author/import-moose-test.pl.
3# DO NOT EDIT THIS FILE. ANY CHANGES WILL BE LOST!!!
4use t::lib::MooseCompat;
b2b106d7 5
6use strict;
7use warnings;
8
fde8e43f 9use Test::More;
b2b106d7 10
11use Mouse::Util::TypeConstraints;
12
13
14{
15 package Foo;
16
17 sub new {
18 my $class = shift;
19
20 return bless {@_}, $class;
21 }
22}
23
24subtype 'FooWithSize'
25 => as 'Foo'
26 => where { $_[0]->{size} };
27
28
29my $type = find_type_constraint('FooWithSize');
30ok( $type, 'made a FooWithSize constraint' );
31ok( $type->parent, 'type has a parent type' );
32is( $type->parent->name, 'Foo', 'parent type is Foo' );
fde8e43f 33isa_ok( $type->parent, 'Mouse::Meta::TypeConstraint',
b2b106d7 34 'parent type constraint is a class type' );
fde8e43f 35
36done_testing;