t0m's around vs. immutable bug
[gitmo/Moose.git] / t / 100_bugs / 015_immutable_n_around.t
CommitLineData
58630bf0 1#!/usr/bin/perl
2
3use strict;
4use warnings;
5
6use 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
37is( Gorch->new->foo, 42, "around new called" );