Commit | Line | Data |
58630bf0 |
1 | #!/usr/bin/perl |
2 | |
3 | use strict; |
4 | use warnings; |
5 | |
6 | use Test::More 'no_plan'; |
7 | |
8 | { |
9 | package Foo; |
10 | use Moose; |
11 | |
12 | has foo => ( is => "ro" ); |
13 | |
14 | __PACKAGE__->meta->make_immutable; |
15 | |
16 | package Bar; |
17 | use Moose; |
18 | |
19 | extends qw(Foo); |
20 | |
21 | around new => sub { |
22 | my $next = shift; |
23 | my ( $self, @args ) = @_; |
24 | $self->$next( foo => 42 ); |
25 | }; |
26 | |
27 | __PACKAGE__->meta->make_immutable; |
28 | |
29 | package Gorch; |
30 | use Moose; |
31 | |
32 | extends qw(Bar); |
33 | |
34 | __PACKAGE__->meta->make_immutable; |
35 | } |
36 | |
37 | is( Gorch->new->foo, 42, "around new called" ); |