blob: c5795cb9798280dd13ec5ba4ca7a4b95e30002e5 (
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
|
use strict;
use warnings;
use Test::More;
use Moose ();
do {
package My::Meta::Role;
use Moose;
extends 'Moose::Meta::Role';
has test_serial => (
is => 'ro',
isa => 'Int',
default => 1,
);
no Moose;
};
my $role = My::Meta::Role->create_anon_role;
is($role->test_serial, 1, "default value for the serial attribute");
my $nine_role = My::Meta::Role->create_anon_role(test_serial => 9);
is($nine_role->test_serial, 9, "parameter value for the serial attribute");
done_testing;
|