Massive cleanup of DateTime test dependencies, other interim
[dbsrgits/DBIx-Class.git] / t / cdbi / set_to_undef.t
1 use strict;
2 use Test::More;
3 use lib 't/cdbi/testlib';
4
5 BEGIN {
6   eval "use DBIx::Class::CDBICompat;use DateTime 0.55;";
7   plan skip_all => "DateTime 0.55, Class::Trigger and DBIx::ContextualFetch required: $@"
8     if $@;
9   plan tests => 2;
10 }
11
12
13 # Don't use Test::NoWarnings because of an unrelated DBD::SQLite warning.
14 my @warnings;
15 local $SIG{__WARN__} = sub {
16     push @warnings, @_;
17 };
18
19 {
20     package Thing;
21
22     use base 'DBIC::Test::SQLite';
23
24     Thing->columns(All  => qw[thing_id this that date]);
25 }
26
27 my $thing = Thing->construct({ thing_id => 23, this => 42 });
28 $thing->set( this => undef );
29 is $thing->get( "this" ), undef, 'undef set';
30 $thing->discard_changes;
31
32 is @warnings, 0, 'no warnings';