Add strict/warnings test, adjust all offenders (wow, that was a lot)
[dbsrgits/DBIx-Class.git] / t / cdbi / set_to_undef.t
CommitLineData
4c9f72c1 1use strict;
4a233f30 2use warnings;
4c9f72c1 3use Test::More;
d9bd5195 4
97d61088 5use lib 't/cdbi/testlib';
d9bd5195 6use DBIC::Test::SQLite (); # this will issue the necessary SKIPs on missing reqs
4c9f72c1 7
8BEGIN {
d9bd5195 9 eval { require DateTime; DateTime->VERSION(0.55) }
10 or plan skip_all => 'DateTime 0.55 required for this test';
4c9f72c1 11}
12
1f17ec27 13
14# Don't use Test::NoWarnings because of an unrelated DBD::SQLite warning.
15my @warnings;
16local $SIG{__WARN__} = sub {
17 push @warnings, @_;
18};
14e38771 19
4c9f72c1 20{
21 package Thing;
22
97d61088 23 use base 'DBIC::Test::SQLite';
4c9f72c1 24
25 Thing->columns(All => qw[thing_id this that date]);
26}
27
28my $thing = Thing->construct({ thing_id => 23, this => 42 });
29$thing->set( this => undef );
1f17ec27 30is $thing->get( "this" ), undef, 'undef set';
4c9f72c1 31$thing->discard_changes;
1f17ec27 32
33is @warnings, 0, 'no warnings';
d9bd5195 34
35done_testing;