summaryrefslogtreecommitdiff
path: root/t/native_traits/array_from_role.t
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@lorry>2015-06-06 17:50:16 +0000
committerLorry Tar Creator <lorry-tar-importer@lorry>2015-06-06 17:50:16 +0000
commit5ac2026f7eed78958d69d051e7a8e993dcf51205 (patch)
tree298c3d2f08bdfe5689998b11892d72a897985be1 /t/native_traits/array_from_role.t
downloadMoose-tarball-5ac2026f7eed78958d69d051e7a8e993dcf51205.tar.gz
Diffstat (limited to 't/native_traits/array_from_role.t')
-rw-r--r--t/native_traits/array_from_role.t44
1 files changed, 44 insertions, 0 deletions
diff --git a/t/native_traits/array_from_role.t b/t/native_traits/array_from_role.t
new file mode 100644
index 0000000..21d0a06
--- /dev/null
+++ b/t/native_traits/array_from_role.t
@@ -0,0 +1,44 @@
+use strict;
+use warnings;
+
+use Test::More;
+use Test::Fatal;
+
+{
+ package Foo;
+ use Moose;
+
+ has 'bar' => ( is => 'rw' );
+
+ package Stuffed::Role;
+ use Moose::Role;
+
+ has 'options' => (
+ traits => ['Array'],
+ is => 'ro',
+ isa => 'ArrayRef[Foo]',
+ );
+
+ package Bulkie::Role;
+ use Moose::Role;
+
+ has 'stuff' => (
+ traits => ['Array'],
+ is => 'ro',
+ isa => 'ArrayRef',
+ handles => {
+ get_stuff => 'get',
+ }
+ );
+
+ package Stuff;
+ use Moose;
+
+ ::is( ::exception { with 'Stuffed::Role';
+ }, undef, '... this should work correctly' );
+
+ ::is( ::exception { with 'Bulkie::Role';
+ }, undef, '... this should work correctly' );
+}
+
+done_testing;