2 # This is automatically generated by author/import-moose-test.pl.
3 # DO NOT EDIT THIS FILE. ANY CHANGES WILL BE LOST!!!
4 use t::lib::MooseCompat;
10 $TODO = q{Mouse is not yet completed};
17 use Mouse::Util::TypeConstraints;
19 # if does() exists on its own, then
20 # we create a type constraint for
21 # it, just as we do for isa()
22 has 'bar' => (is => 'rw', does => 'Bar::Role');
25 does => role_type('Bar::Role')
36 # if isa and does appear together, then see if Class->does(Role)
37 # if it does work... then the does() check is actually not needed
38 # since the isa() check will imply the does() check
39 has 'foo' => (is => 'rw', isa => 'Foo::Class', does => 'Foo::Role');
47 my $foo = Foo::Class->new;
48 isa_ok($foo, 'Foo::Class');
50 my $bar = Bar::Class->new;
51 isa_ok($bar, 'Bar::Class');
55 } '... bar passed the type constraint okay';
59 } '... foo did not pass the type constraint okay';
63 } '... baz passed the type constraint okay';
67 } '... foo did not pass the type constraint okay';
71 } '... foo passed the type constraint okay';
75 # some error conditions
81 # if isa and does appear together, then see if Class->does(Role)
82 # if it does not,.. we have a conflict... so we die loudly
84 has 'foo' => (isa => 'Foo::Class', does => 'Bar::Class');
85 } '... cannot have a does() which is not done by the isa()';
93 sub bling { 'Bling::bling' }
98 # if isa and does appear together, then see if Class->does(Role)
99 # if it does not,.. we have a conflict... so we die loudly
101 has 'foo' => (isa => 'Bling', does => 'Bar::Class');
102 } '... cannot have a isa() which is cannot does()';