Workaround older perl's bug that caused segv by releasing CVs
[gitmo/Mouse.git] / t / 001_mouse / 069-add-modifier.t
index 2a2462a..1a57606 100644 (file)
@@ -1,10 +1,15 @@
 #!perl
 use strict;
 use warnings;
+use lib 't/lib';
 
 use Test::More;
 use Test::Exception;
 
+throws_ok {
+    A->meta->add_around_method_modifier(bar => sub { "baz" });
+} qr/The method 'bar' was not found in the inheritance hierarchy for A/;
+
 {
     package A;
     use Mouse;
@@ -16,8 +21,4 @@ A->meta->add_around_method_modifier(foo => sub { "bar" });
 
 is(A->foo(), 'bar', 'add_around_modifier');
 
-throws_ok {
-    A->meta->add_around_method_modifier(bar => sub { "baz" });
-} qr/The method 'bar' was not found in the inheritance hierarchy for A/;
-
 done_testing;