extra test from FAIL_modify_lazy_handlers
[gitmo/Moo.git] / t / lib / MooObjectWithDelegate.pm
CommitLineData
777fcfcf 1package MooObjectWithDelegate;
2use ClassicObject;
3use Moo;
4
5has 'delegated' => (
6 is => 'ro',
7 isa => sub {
8 do { $_[0] && blessed($_[0]) }
9 or die "Not an Object!";
10 },
11 lazy => 1,
12 builder => '_build_delegated',
13 handles => [qw/connect/],
14);
15
16sub _build_delegated {
17 my $self = shift;
18 return ClassicObject->new;
19}
20
21around 'connect', sub {
22 my ($orig, $self, @args) = @_;
23 return $self->$orig(@args) . 'b';
24};
25
26
271;