};
}
+ # workaround older Perl's bug that caused segv :(
+ {
+ no warnings 'once';
+ our $__not_used = \&_install_modifier; # keep the CV not to be released
+ }
+
# replace this method itself :)
{
no warnings 'redefine';
#!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;
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;