From: gfx Date: Fri, 10 Sep 2010 04:02:23 +0000 (+0900) Subject: Add test for method modifiers X-Git-Tag: 0.66~4 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=5c713614f1f6cee9043685ff3b8f253f4d3a65c9;p=gitmo%2FMouse.git Add test for method modifiers --- diff --git a/t/001_mouse/069-add-modifier.t b/t/001_mouse/069-add-modifier.t new file mode 100644 index 0000000..2a2462a --- /dev/null +++ b/t/001_mouse/069-add-modifier.t @@ -0,0 +1,23 @@ +#!perl +use strict; +use warnings; + +use Test::More; +use Test::Exception; + +{ + package A; + use Mouse; + + sub foo { "foo" }; +} + +A->meta->add_around_method_modifier(foo => sub { "bar" }); + +is(A->foo(), 'bar', 'add_around_modifier'); + +throws_ok { + A->meta->add_around_method_modifier(bar => sub { "baz" }); +} qr/The method 'bar' was not found in the inheritance hierarchy for A/; + +done_testing;