|
use if $ENV {AUTHOR_TESTING}, 'Test::Warnings' ;
do {
eval { before foo => sub {}; };
::like($@,
qr/The method 'foo' is not found in the inheritance hierarchy for class Class1/ ,
);
};
do {
eval { after foo => sub {}; };
::like(
$@,
qr/The method 'foo' is not found in the inheritance hierarchy for class Class2/ ,
);
};
do {
eval { around foo => sub {}; };
::like(
$@,
qr/The method 'foo' is not found in the inheritance hierarchy for class Class3/ ,
);
};
do {
sub foo {}
eval { around 'foo' , 'bar' => sub {}; };
::like(
$@,
qr/The method 'bar' is not found in the inheritance hierarchy for class Class4/ ,
);
};
done_testing;
|