failing test class_type meta class
Moritz Onken [Sat, 13 Jun 2009 22:09:22 +0000 (00:09 +0200)]
t/040_type_constraints/035_type_class_meta.t [new file with mode: 0644]

diff --git a/t/040_type_constraints/035_type_class_meta.t b/t/040_type_constraints/035_type_class_meta.t
new file mode 100644 (file)
index 0000000..67f0532
--- /dev/null
@@ -0,0 +1,28 @@
+use strict;
+use Test::More tests => 1;
+
+{ 
+package Type;
+use Moose;
+}
+
+{ package 
+  Signatures;
+
+use Moose;
+
+use Moose::Util::TypeConstraints;
+
+subtype CustomType => as class_type('Type');
+subtype CustomType2 => as 'Type';
+
+has file => ( isa => 'CustomType', is => 'rw' );
+has file2 => ( isa => 'CustomType2', is => 'rw' );
+}
+
+
+my $sig = new Signatures;
+$sig->file(Type->new);
+
+is(ref $sig->meta->get_attribute('file')->type_constraint, 'Moose::Meta::TypeConstraint::Class');
+is(ref $sig->meta->get_attribute('file2')->type_constraint, 'Moose::Meta::TypeConstraint::Class');
\ No newline at end of file