Commit | Line | Data |
---|---|---|
5c713614 | 1 | #!perl |
2 | use strict; | |
3 | use warnings; | |
4 | ||
5 | use Test::More; | |
6 | use Test::Exception; | |
7 | ||
8 | { | |
9 | package A; | |
10 | use Mouse; | |
11 | ||
12 | sub foo { "foo" }; | |
13 | } | |
14 | ||
15 | A->meta->add_around_method_modifier(foo => sub { "bar" }); | |
16 | ||
17 | is(A->foo(), 'bar', 'add_around_modifier'); | |
18 | ||
19 | throws_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 | ||
23 | done_testing; |