added some totally broken tests, and basically broke everything :)
John Napiorkowski [Fri, 22 Aug 2008 21:43:31 +0000 (21:43 +0000)]
TODO [new file with mode: 0644]
lib/MooseX/Types.pm
t/13_typedecorator.t [new file with mode: 0644]

diff --git a/TODO b/TODO
new file mode 100644 (file)
index 0000000..b261896
--- /dev/null
+++ b/TODO
@@ -0,0 +1,12 @@
+- We need a Role for Moose::Meta::TypeConstraint to define the interface we are decorating
+- we need a Role or some way to detect when there are parameters attached to the type
+
+??Do we need some sort of Factory for controlling the creation of types?
+
+Moose::TypeConstraint->create_base(%opt);
+Moose::TypeConstraint->create_structured(%opt, %signature_opts);
+Moose::TypeConstraint->create_parameterized(%opt, %);
+
+then a ...->create(%opt) that chooses one of the above????
+
+
index eb443bf..c56d45e 100644 (file)
@@ -304,9 +304,15 @@ sub type_export_generator {
     my ($class, $type, $full) = @_;
     return sub {
         my @args = @_;
-        use Data::Dump qw/dump/; warn @args;
+        use Data::Dump qw/dump/; warn dump @args if @args;
         my $type_constraint = find_type_constraint($full)
          || MooseX::Types::UndefinedType->new($full);
+         
+        if(@args) {
+            my $tc = $args[0]->[0];
+            warn dump $tc;
+            $type_constraint->type_constraint($tc);
+        }
         return MooseX::Types::TypeDecorator->new(type_constraint=>$type_constraint);
     };
 }
diff --git a/t/13_typedecorator.t b/t/13_typedecorator.t
new file mode 100644 (file)
index 0000000..8afec9d
--- /dev/null
@@ -0,0 +1,12 @@
+#!/usr/bin/env perl
+use warnings;
+use strict;
+
+use Test::More tests => 1;
+use FindBin;
+use lib "$FindBin::Bin/lib";
+use DecoratorLibrary qw( ArrayOfInts);
+
+is 1,1, 'ok';
+
+use Data::Dump qw/dump/;