Fix annoying warnings on innocent looking MSSQL code
[dbsrgits/DBIx-Class.git] / t / multi_create / insert_defaults.t
index e8054a7..d7839c1 100644 (file)
@@ -1,12 +1,12 @@
+BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) }
+
 use strict;
 use warnings;
 
 use Test::More;
-use Test::Exception;
-use lib qw(t/lib);
-use DBICTest;
 
-plan tests => 8;
+use DBICTest;
+use DBIx::Class::_Util 'sigwarn_silencer';
 
 my $schema = DBICTest->init_schema();
 
@@ -40,6 +40,8 @@ is_deeply ({ $o0->columns}, {$last_bookmark->columns}, 'Correctly identify a row
 my $o3 = $last_link->create_related ('bookmarks', {});
 is ($o3->id, $last_bookmark->id + 3, '3rd bookmark ID');
 
-local $SIG{__WARN__} = sub { warn @_ unless $_[0] =~ /Query returned more than one row/ };
+local $SIG{__WARN__} = sigwarn_silencer( qr/Query returned more than one row/ );
 my $oX = $bookmark_rs->find_or_create ({ link => $last_link });
 is_deeply ({ $oX->columns}, {$last_bookmark->columns}, 'Correctly identify a row given a relationship');
+
+done_testing;