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