Commit | Line | Data |
4c9f72c1 |
1 | #!/usr/bin/perl -w |
2 | |
3 | use strict; |
4 | use Test::More; |
4c9f72c1 |
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 }; |
1f17ec27 |
11 | plan tests => 2; |
4c9f72c1 |
12 | } |
13 | |
1f17ec27 |
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 | }; |
14e38771 |
20 | |
4c9f72c1 |
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 ); |
1f17ec27 |
31 | is $thing->get( "this" ), undef, 'undef set'; |
4c9f72c1 |
32 | $thing->discard_changes; |
1f17ec27 |
33 | |
34 | is @warnings, 0, 'no warnings'; |