version bump
[gitmo/Moose.git] / t / compat / composite_metaroles.t
CommitLineData
6e15f532 1#!/usr/bin/env perl
2use strict;
3use warnings;
4use Test::More;
b10dde3a 5use Test::Fatal;
6e15f532 6use Test::Moose;
7
8{
9 package Foo::Role;
10 use Moose::Role;
11}
12
13{
14 package Bar::Role;
15 use Moose::Role;
16}
17
18{
19 package Parent;
20 use Moose;
21 Moose::Util::MetaRole::apply_metaroles(
22 for => __PACKAGE__,
23 class_metaroles => { class => ['Foo::Role'] },
24 );
25}
26
27{
28 package Child;
29 use Moose;
30 Moose::Util::MetaRole::apply_metaroles(
31 for => __PACKAGE__,
32 class_metaroles => { class => ['Foo::Role', 'Bar::Role'] },
33 );
b10dde3a 34 ::is( ::exception { extends 'Parent' }, undef );
6e15f532 35}
36
37with_immutable {
38 isa_ok('Child', 'Parent');
39 isa_ok(Child->meta, Parent->meta->_real_ref_name);
40 does_ok(Parent->meta, 'Foo::Role');
41 does_ok(Child->meta, 'Foo::Role');
42 does_ok(Child->meta, 'Bar::Role');
43} 'Parent', 'Child';
44
45done_testing;