Mouse::Util::does_role() respects $thing->does() method
[gitmo/Mouse.git] / t / 001_mouse / 069-add-modifier.t
1 #!perl
2 use strict;
3 use warnings;
4 use lib 't/lib';
5
6 use Test::More;
7 use Test::Exception;
8
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
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
24 done_testing;