Changed MX:T:DateTime to use MX:Types. Updated MX:T:DateTimeX to respect changes...
[gitmo/MooseX-Types-DateTime.git] / t / 01_basic.t
index 3a61db1..f4a4626 100644 (file)
@@ -129,3 +129,22 @@ isa_ok( find_type_constraint($_), "Moose::Meta::TypeConstraint" ) for qw(DateTim
         isa_ok( Gorch->new( loc => $handle )->loc, "DateTime::Locale::ja", "coerced from maketext" );;
     }
 }
+
+{
+       {
+               package Gondor;
+               
+               use Moose;
+               use MooseX::Types::DateTime qw(DateTime Duration);
+       
+               has 'date' => (is=>'rw', isa=>DateTime, coerce=>1);
+               has 'duration' => (is=>'rw', isa=>Duration, coerce=>1); 
+               
+       }
+       
+       my $epoch = time;
+       
+       ok my $gondor = Gondor->new(date=>$epoch, duration=>10)
+       => 'Instantiated object using export types';
+       
+}