Commit | Line | Data |
5c713614 |
1 | #!perl |
2 | use strict; |
3 | use warnings; |
aa3b1c11 |
4 | use lib 't/lib'; |
5c713614 |
5 | |
6 | use Test::More; |
7 | use Test::Exception; |
8 | |
aa3b1c11 |
9 | throws_ok { |
10 | A->meta->add_around_method_modifier(bar => sub { "baz" }); |
11 | } qr/The method 'bar' was not found in the inheritance hierarchy for A/; |
12 | |
5c713614 |
13 | { |
14 | package A; |
15 | use Mouse; |
16 | |
17 | sub foo { "foo" }; |
18 | } |
19 | |
20 | A->meta->add_around_method_modifier(foo => sub { "bar" }); |
21 | |
22 | is(A->foo(), 'bar', 'add_around_modifier'); |
23 | |
5c713614 |
24 | done_testing; |