Test that before/after/around live, and defining a sub within a role
[gitmo/Mouse.git] / t / 400-define-role.t
index 7ece4ec..0920e35 100644 (file)
@@ -1,7 +1,7 @@
 #!/usr/bin/env perl
 use strict;
 use warnings;
-use Test::More tests => 2;
+use Test::More tests => 4;
 use Test::Exception;
 
 lives_ok {
@@ -20,3 +20,19 @@ throws_ok {
     no Mouse::Role;
 } qr/Role does not currently support 'extends'/;
 
+lives_ok {
+    package Role;
+    use Mouse::Role;
+
+    sub foo {}
+};
+
+lives_ok {
+    package Role;
+    use Mouse::Role;
+
+    before foo => sub {};
+    after foo  => sub {};
+    around foo => sub {};
+};
+