[Moose-commits] r7469 - MooseX-Params-Validate/trunk/t

autarch at code2.0beta.co.uk autarch at code2.0beta.co.uk
Sun Feb 1 15:42:32 GMT 2009


Author: autarch
Date: 2009-02-01 07:42:31 -0800 (Sun, 01 Feb 2009)
New Revision: 7469

Modified:
   MooseX-Params-Validate/trunk/t/004_custom_cache_key.t
   MooseX-Params-Validate/trunk/t/005_coercion.t
Log:
switch all the rest over to throws_ok

Modified: MooseX-Params-Validate/trunk/t/004_custom_cache_key.t
===================================================================
--- MooseX-Params-Validate/trunk/t/004_custom_cache_key.t	2009-02-01 15:40:20 UTC (rev 7468)
+++ MooseX-Params-Validate/trunk/t/004_custom_cache_key.t	2009-02-01 15:42:31 UTC (rev 7469)
@@ -28,9 +28,9 @@
 }
 '... successfully applied the parameter validation';
 
-dies_ok {
+throws_ok {
     $foo->bar( [ baz => [ 1, 2, 3 ] ], { baz => { isa => 'ArrayRef' } } );
-}
+} qr/\QThe 'baz' parameter/,
 '... successfully re-used the parameter validation for this instance';
 
 my $foo2 = Foo->new;
@@ -41,9 +41,9 @@
 }
 '... successfully applied the parameter validation';
 
-dies_ok {
+throws_ok {
     $foo2->bar( [ baz => 1 ], { baz => { isa => 'Int' } } );
-}
+} qr/\QThe 'baz' parameter/,
 '... successfully re-used the parameter validation for this instance';
 
 lives_ok {

Modified: MooseX-Params-Validate/trunk/t/005_coercion.t
===================================================================
--- MooseX-Params-Validate/trunk/t/005_coercion.t	2009-02-01 15:40:20 UTC (rev 7468)
+++ MooseX-Params-Validate/trunk/t/005_coercion.t	2009-02-01 15:42:31 UTC (rev 7469)
@@ -54,11 +54,13 @@
     'got the return value right with coercions for size1'
 );
 
-dies_ok { $foo->bar( size1 => 30, size2 => [ 1, 2, 3 ], number => 30 ) }
-'... the size2 param cannot be coerced';
+throws_ok { $foo->bar( size1 => 30, size2 => [ 1, 2, 3 ], number => 30 ) }
+qr/\QThe 'size2' parameter/,
+    '... the size2 param cannot be coerced';
 
-dies_ok { $foo->bar( size1 => 30, size2 => 10, number => 'something' ) }
-'... the number param cannot be coerced';
+throws_ok { $foo->bar( size1 => 30, size2 => 10, number => 'something' ) }
+qr/\QThe 'number' parameter/,
+    '... the number param cannot be coerced';
 
 is_deeply(
     $foo->baz( size1 => 10, size2 => 20, number => 30 ),
@@ -72,8 +74,10 @@
     'got the return value right with coercions for size1'
 );
 
-dies_ok { $foo->baz( size1 => 30, size2 => [ 1, 2, 3 ], number => 30 ) }
-'... the size2 param cannot be coerced';
+throws_ok { $foo->baz( size1 => 30, size2 => [ 1, 2, 3 ], number => 30 ) }
+qr/\QThe 'size2' parameter/,
+    '... the size2 param cannot be coerced';
 
-dies_ok { $foo->baz( size1 => 30, size2 => 10, number => 'something' ) }
-'... the number param cannot be coerced';
+throws_ok { $foo->baz( size1 => 30, size2 => 10, number => 'something' ) }
+qr/\QThe 'number' parameter/,
+    '... the number param cannot be coerced';




More information about the Moose-commits mailing list