From: Dave Rolsky Date: Fri, 20 Feb 2009 19:22:15 +0000 (+0000) Subject: Add a test for adding a method modifier to a method added after class was first defined X-Git-Tag: 0.77_01~6 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=823070664f05afbba8ef77fbcb52176ea1806dd7;p=gitmo%2FClass-MOP.git Add a test for adding a method modifier to a method added after class was first defined --- diff --git a/t/017_add_method_modifier.t b/t/017_add_method_modifier.t index 788dac0..37ecf5c 100644 --- a/t/017_add_method_modifier.t +++ b/t/017_add_method_modifier.t @@ -1,7 +1,7 @@ use strict; use warnings; -use Test::More tests => 20; +use Test::More tests => 21; use Test::Exception; use Class::MOP; @@ -79,6 +79,11 @@ use Class::MOP; 'Class::MOP::Method::Wrapped' ); ::isa_ok( BankAccount->meta->get_method('withdraw'), 'Class::MOP::Method' ); + + CheckingAccount->meta->add_method( foo => sub { 'foo' } ); + CheckingAccount->meta->add_before_method_modifier( foo => sub { 'wrapped' } ); + ::isa_ok( CheckingAccount->meta->get_method('foo'), + 'Class::MOP::Method::Wrapped' ); } my $savings_account = BankAccount->new( balance => 250 );