add test for using a role in a typelib
Rafael Kitover [Mon, 15 Jun 2009 01:06:51 +0000 (18:06 -0700)]
t/19_typelib_with_role.t [new file with mode: 0644]

diff --git a/t/19_typelib_with_role.t b/t/19_typelib_with_role.t
new file mode 100644 (file)
index 0000000..af5acd0
--- /dev/null
@@ -0,0 +1,26 @@
+#!/usr/bin/env perl
+use strict;
+use warnings;
+use Test::More tests => 1;
+
+{
+    package MyRole;
+    use Moose::Role;
+    requires 'foo';
+}
+
+eval q{
+
+    package MyClass;
+    use Moose;
+    use MooseX::Types -declare => ['Foo'];
+    use MooseX::Types::Moose 'Int';
+    with 'MyRole';
+
+    subtype Foo, as Int;
+
+    sub foo {}
+};
+
+ok !$@, 'type export not picked up as a method on role application';