Test that DateTime objects can safely be updated twice (which is what triggers
[dbsrgits/DBIx-Class.git] / t / cdbi-t / set_vs_DateTime.t
index 84842bf..fb76561 100644 (file)
@@ -2,6 +2,7 @@
 
 use strict;
 use Test::More;
+use Test::Exception;
 
 BEGIN {
   eval "use DBIx::Class::CDBICompat;";
@@ -20,9 +21,12 @@ BEGIN {
 }
 
 my $thing = Thing->construct({ thing_id => 23, date => "01-02-1994" });
-eval {
-  $thing->set( date => DateTime->now );
+my $date = DateTime->now;
+lives_ok {
+  $thing->set( date => $date );
+  $thing->set( date => $date );
 };
-is $@, '';
+
+
 
 $thing->discard_changes;