Regenerate test files
[gitmo/Mouse.git] / t / 200_examples / 004_example_w_DCS.t
index 00e8dce..1ec0149 100644 (file)
@@ -1,4 +1,7 @@
 #!/usr/bin/perl
+# This is automatically generated by author/import-moose-test.pl.
+# DO NOT EDIT THIS FILE. ANY CHANGES WILL BE LOST!!!
+use t::lib::MooseCompat;
 
 use strict;
 use warnings;
@@ -14,11 +17,9 @@ Pretty well if I do say so myself :)
 
 =cut
 
-BEGIN {
-    eval "use Declare::Constraints::Simple;";
-    plan skip_all => "Declare::Constraints::Simple is required for this test" if $@;
-    plan tests => 9;
-}
+use Test::Requires {
+    'Declare::Constraints::Simple' => '0.01', # skip all if not installed
+};
 
 use Test::Exception;
 
@@ -30,11 +31,12 @@ use Test::Exception;
 
     # define your own type ...
     type( 'HashOfArrayOfObjects',
+        {
         where => IsHashRef(
             -keys   => HasLength,
             -values => IsArrayRef(IsObject)
         )
-    );
+    } );
 
     has 'bar' => (
         is  => 'rw',
@@ -44,7 +46,7 @@ use Test::Exception;
     # inline the constraints as anon-subtypes
     has 'baz' => (
         is  => 'rw',
-        isa => subtype( as => 'ArrayRef', where => IsArrayRef(IsInt) ),
+        isa => subtype( { as => 'ArrayRef', where => IsArrayRef(IsInt) } ),
     );
 
     package Bar;
@@ -82,7 +84,6 @@ dies_ok {
     $foo->bar({ foo => [ 1, 2, 3 ] });
 } '... validation failed correctly';
 
-
 dies_ok {
     $foo->baz([ "foo" ]);
 } '... validation failed correctly';
@@ -90,3 +91,5 @@ dies_ok {
 dies_ok {
     $foo->baz({});
 } '... validation failed correctly';
+
+done_testing;