Your IP : 216.73.216.1


Current Path : /usr/share/doc/perl-MooseX-Role-Parameterized/t/
Upload File :
Current File : //usr/share/doc/perl-MooseX-Role-Parameterized/t/014-compose-parameterizable.t

use strict;
use warnings;
use Test::More 0.88;

do {
    package MyRole;
    use MooseX::Role::Parameterized;

    parameter attribute => (
        isa => 'Str',
    );

    sub meth { 1 }

    role {
        my $p = shift;

        has $p->attribute => (
            is => 'ro',
        );
    };
};

do {
    package MyClass;
    use Moose;
    with 'MyRole' => {
        attribute => 'attr',
    };
};

ok(MyClass->can('attr'), "the parameterized attribute was composed");
ok(MyClass->can('meth'), "the unparameterized method was composed");

done_testing;