[Moose-commits] r7754 - Class-MOP/trunk/t

autarch at code2.0beta.co.uk autarch at code2.0beta.co.uk
Fri Feb 20 18:23:12 GMT 2009


Author: autarch
Date: 2009-02-20 10:23:12 -0800 (Fri, 20 Feb 2009)
New Revision: 7754

Modified:
   Class-MOP/trunk/t/017_add_method_modifier.t
Log:
Add a test for wrapping a method which doesn't exist.


Modified: Class-MOP/trunk/t/017_add_method_modifier.t
===================================================================
--- Class-MOP/trunk/t/017_add_method_modifier.t	2009-02-20 18:22:35 UTC (rev 7753)
+++ Class-MOP/trunk/t/017_add_method_modifier.t	2009-02-20 18:23:12 UTC (rev 7754)
@@ -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 @@
         }
     );
 
+    ::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'),




More information about the Moose-commits mailing list