Mouse::Util::does_role() respects $thing->does() method
[gitmo/Mouse.git] / t / 001_mouse / 069-add-modifier.t
CommitLineData
5c713614 1#!perl
2use strict;
3use warnings;
aa3b1c11 4use lib 't/lib';
5c713614 5
6use Test::More;
7use Test::Exception;
8
aa3b1c11 9throws_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
20A->meta->add_around_method_modifier(foo => sub { "bar" });
21
22is(A->foo(), 'bar', 'add_around_modifier');
23
5c713614 24done_testing;