From: Dave Rolsky Date: Fri, 20 Feb 2009 18:23:12 +0000 (+0000) Subject: Add a test for wrapping a method which doesn't exist. X-Git-Tag: 0.77_01~8 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=cc6c0b0b454a0ae98596e5b0d25225711b873fb1;p=gitmo%2FClass-MOP.git Add a test for wrapping a method which doesn't exist. --- diff --git a/t/017_add_method_modifier.t b/t/017_add_method_modifier.t index 753e2ca..c116c0b 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 => 19; +use Test::More tests => 20; use Test::Exception; use Class::MOP; @@ -65,6 +65,14 @@ use Class::MOP; } ); + ::throws_ok( + sub { + CheckingAccount->meta->add_before_method_modifier( + 'does_not_exist' => sub { } ); + }, + qr/\QThe method 'does_not_exist' was not found in the inheritance hierarchy for CheckingAccount/ + ); + ::ok( CheckingAccount->meta->has_method('withdraw'), '... checking account now has a withdraw method' ); ::isa_ok( CheckingAccount->meta->get_method('withdraw'),