projects
/
gitmo/Moo.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
Add failing test for overriding default with '+attr'
[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
is(
26
MooseChild->new->foo,
27
'MooseChild',
28
'default value in Moose child'
29
);
30
31
done_testing;
32