From: Guillermo Roditi Date: Fri, 28 Mar 2008 19:43:48 +0000 (+0000) Subject: more behavior X-Git-Tag: 0_55~77^2 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=21158859b7590397e7dfb723f5d4f678af70516f;p=gitmo%2FMoose.git more behavior --- diff --git a/t/300_immutable/007_inlined_constructor_modified_new.t b/t/300_immutable/007_inlined_constructor_modified_new.t index 9c8f026..4b25daf 100644 --- a/t/300_immutable/007_inlined_constructor_modified_new.t +++ b/t/300_immutable/007_inlined_constructor_modified_new.t @@ -12,6 +12,11 @@ my ($around_new); around new => sub { my $o = shift; $around_new = 1; $o->(@_); }; has 'foo' => (is => 'rw', isa => 'Int'); + + package Bar; + use Moose; + extends 'Foo'; + Bar->meta->make_immutable; } my $orig_new = Foo->meta->find_method_by_name('new'); @@ -25,6 +30,9 @@ isa_ok($inlined_new, 'Class::MOP::Method::Wrapped'); $inlined_new = $inlined_new->get_original_method; isa_ok($inlined_new, 'Moose::Meta::Method::Constructor'); -my $foo = Foo->new(foo => 100); +Foo->new(foo => 100); ok($around_new, 'around new called'); +$around_new = 0; +Bar->new(foo => 100); +ok($around_new, 'around new called');