projects
/
gitmo/Moo.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
don't copy delegates into overridden attributes
[gitmo/Moo.git]
/
xt
/
moose-override-attribute-with-plus-syntax.t
1
use strict;
2
use warnings;
3
use Test::More;
4
use Test::Fatal;
5
6
{
7
package MooParent;
8
use Moo;
9
10
has foo => (
11
is => 'ro',
12
default => sub { 'MooParent' },
13
);
14
}
15
{
16
package MooseChild;
17
use Moose;
18
extends 'MooParent';
19
20
has '+foo' => (
21
default => 'MooseChild',
22
);
23
}
24
{
25
package MooseChild2;
26
use Moose;
27
extends 'MooParent';
28
29
has '+foo' => (
30
default => 'MooseChild2',
31
);
32
__PACKAGE__->meta->make_immutable
33
}
34
35
is(
36
MooseChild->new->foo,
37
'MooseChild',
38
'default value in Moose child'
39
);
40
41
is(
42
MooseChild2->new->foo,
43
'MooseChild2',
44
'default value in Moose child'
45
);
46
47
done_testing;
48