Add strict/warnings test, adjust all offenders (wow, that was a lot)
[dbsrgits/DBIx-Class.git] / t / cdbi / set_vs_DateTime.t
1 use strict;
2 use warnings;
3 use Test::More;
4 use Test::Exception;
5
6 use lib 't/cdbi/testlib';
7 use DBIC::Test::SQLite (); # this will issue the necessary SKIPs on missing reqs
8
9 BEGIN {
10   eval { require DateTime; DateTime->VERSION(0.55) }
11     or plan skip_all => 'DateTime 0.55 required for this test';
12 }
13
14 {
15     package Thing;
16
17     use base 'DBIC::Test::SQLite';
18
19     Thing->columns(All  => qw[thing_id this that date]);
20 }
21
22 my $thing = Thing->construct({ thing_id => 23, date => "01-02-1994" });
23 my $date = DateTime->now;
24 lives_ok {
25   $thing->set( date => $date );
26   $thing->set( date => $date );
27 };
28
29 $thing->discard_changes;
30
31 done_testing;