Add test for method modifiers
gfx [Fri, 10 Sep 2010 04:02:23 +0000 (13:02 +0900)]
t/001_mouse/069-add-modifier.t [new file with mode: 0644]

diff --git a/t/001_mouse/069-add-modifier.t b/t/001_mouse/069-add-modifier.t
new file mode 100644 (file)
index 0000000..2a2462a
--- /dev/null
@@ -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;