Add test for method modifiers
[gitmo/Mouse.git] / t / 001_mouse / 069-add-modifier.t
CommitLineData
5c713614 1#!perl
2use strict;
3use warnings;
4
5use Test::More;
6use Test::Exception;
7
8{
9 package A;
10 use Mouse;
11
12 sub foo { "foo" };
13}
14
15A->meta->add_around_method_modifier(foo => sub { "bar" });
16
17is(A->foo(), 'bar', 'add_around_modifier');
18
19throws_ok {
20 A->meta->add_around_method_modifier(bar => sub { "baz" });
21} qr/The method 'bar' was not found in the inheritance hierarchy for A/;
22
23done_testing;