X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F90ensure_class_loaded.t;h=e933c00a370a97a7b28fc875b9d22c1bd17a5a45;hb=a02d6f59921ef4d04ee17710c7a8bb7aeef10799;hp=f14911dce80b0a81a5e47e3cc1cc2bcebe6c4df7;hpb=8273e845426f0187b4ad6c4a1b42286fa09a648f;p=dbsrgits%2FDBIx-Class.git diff --git a/t/90ensure_class_loaded.t b/t/90ensure_class_loaded.t index f14911d..e933c00 100644 --- a/t/90ensure_class_loaded.t +++ b/t/90ensure_class_loaded.t @@ -4,6 +4,7 @@ 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/,