Annoying DBD::SQLite warning is tripping up Test::NoWarnings.
[dbsrgits/DBIx-Class.git] / t / cdbi-t / set_to_undef.t
index 75e0ee6..792c55e 100644 (file)
@@ -8,10 +8,15 @@ BEGIN {
   plan skip_all => "Class::Trigger and DBIx::ContextualFetch required: $@"
     if $@;
   plan skip_all => "DateTime required" unless eval { require DateTime };
-  plan tests => 1;
+  plan tests => 2;
 }
 
-use Test::NoWarnings;
+
+# Don't use Test::NoWarnings because of an unrelated DBD::SQLite warning.
+my @warnings;
+local $SIG{__WARN__} = sub {
+    push @warnings, @_;
+};
 
 {
     package Thing;
@@ -23,4 +28,7 @@ use Test::NoWarnings;
 
 my $thing = Thing->construct({ thing_id => 23, this => 42 });
 $thing->set( this => undef );
+is $thing->get( "this" ), undef, 'undef set';
 $thing->discard_changes;
+
+is @warnings, 0, 'no warnings';