X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F90ensure_class_loaded.t;h=e933c00a370a97a7b28fc875b9d22c1bd17a5a45;hb=cfa1ab03f5bdd0f14f4eaca99cd002be0020d001;hp=1746d4c2cf370386cd4796efbce2ddd9649c3b48;hpb=504870a5f5a33ba88c5c22cbfa41579433dd49f3;p=dbsrgits%2FDBIx-Class.git diff --git a/t/90ensure_class_loaded.t b/t/90ensure_class_loaded.t index 1746d4c..e933c00 100644 --- a/t/90ensure_class_loaded.t +++ b/t/90ensure_class_loaded.t @@ -1,9 +1,10 @@ use strict; -use warnings; +use warnings; use Test::More; use lib qw(t/lib); use DBICTest; +use DBIx::Class::_Util 'sigwarn_silencer'; use Class::Inspector; BEGIN { @@ -100,13 +101,9 @@ ok( Class::Inspector->loaded('DBICTest::FakeComponent'), { # Squash warnings about syntax errors in SytaxErrorComponent.pm - local $SIG{__WARN__} = sub { - my $warning = shift; - warn $warning unless ( - $warning =~ /String found where operator expected/ or - $warning =~ /Missing operator before/ - ); - }; + local $SIG{__WARN__} = sigwarn_silencer( + qr/String found where operator expected|Missing operator before/ + ); eval { $schema->ensure_class_loaded('DBICTest::SyntaxErrorComponent1') }; like( $@, qr/syntax error/,