summaryrefslogtreecommitdiff
path: root/t/roles/role_attribute_conflict.t
blob: d4ad4c5add02956dbc2ae5c9200083231a2008b6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
use strict;
use warnings;

use Test::More;
use Test::Fatal;

{
    package My::Role1;
    use Moose::Role;

    has foo => (
        is => 'ro',
    );

}

{
    package My::Role2;
    use Moose::Role;

    has foo => (
        is => 'ro',
    );

    ::like( ::exception { with 'My::Role1' }, qr/attribute conflict.+My::Role2.+foo/, 'attribute conflict when composing one role into another' );
}

done_testing;