Sophie

Sophie

distrib > Fedora > 18 > i386 > by-pkgid > a33d845846fb586be2993c6eed227050 > files > 52

perl-MooseX-MethodAttributes-0.28-1.fc18.noarch.rpm

use strict;
use warnings;
{
    package RoleOne;
    use MooseX::MethodAttributes::Role;

    sub foo {}
}
{
    package RoleTwo;
    use MooseX::MethodAttributes::Role;

    sub foo {}
}
{
    package RoleThree;
    use MooseX::MethodAttributes::Role;

    sub foo : Action {}
}
{
    package RoleFour;
    use MooseX::MethodAttributes::Role;

    sub foo : ActionRole {}
}
{
    package MyClass;
    use Moose;
    use Test::More tests => 3;
    use Test::Exception;

    throws_ok { with qw/RoleOne RoleTwo/; } qr/method name conflict/,
        'Normal methods conflict detected';

    throws_ok { with qw/RoleThree RoleFour/; } qr/method name conflict/,
        'Attributed methods conflict detected';

    throws_ok { with qw/RoleOne RoleFour/; } qr/method name conflict/,
        'Attributed and non attributed methods combination - conflict detected';
}