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