Switch CDBICompat and its tests to OptDeps
[dbsrgits/DBIx-Class.git] / t / cdbi / set_to_undef.t
CommitLineData
83eef562 1use DBIx::Class::Optional::Dependencies -skip_all_without => qw( icdt cdbicompat );
2
4c9f72c1 3use strict;
4a233f30 4use warnings;
d9bd5195 5
83eef562 6use Test::More;
97d61088 7use lib 't/cdbi/testlib';
1f17ec27 8
9# Don't use Test::NoWarnings because of an unrelated DBD::SQLite warning.
10my @warnings;
11local $SIG{__WARN__} = sub {
12 push @warnings, @_;
13};
14e38771 14
4c9f72c1 15{
16 package Thing;
17
97d61088 18 use base 'DBIC::Test::SQLite';
4c9f72c1 19
20 Thing->columns(All => qw[thing_id this that date]);
21}
22
23my $thing = Thing->construct({ thing_id => 23, this => 42 });
24$thing->set( this => undef );
1f17ec27 25is $thing->get( "this" ), undef, 'undef set';
4c9f72c1 26$thing->discard_changes;
1f17ec27 27
28is @warnings, 0, 'no warnings';
d9bd5195 29
30done_testing;