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 {
q/0;/,
);
- TODO: {
- local $TODO = "Current load_optional_class cannot find PAR";
- $retval = eval { $schema->load_optional_class('VIRTUAL::PAR::PACKAGE') };
- ok( $@, 'load_optional_class of a no-true-returning PAR module did throw' );
- ok( !$retval, 'no-true-returning PAR package not loaded' );
- }
+ $retval = eval { $schema->load_optional_class('VIRTUAL::PAR::PACKAGE') };
+ ok( $@, 'load_optional_class of a no-true-returning PAR module did throw' );
+ ok( !$retval, 'no-true-returning PAR package not loaded' );
# simulate a normal class (no one adjusted %INC so it will be tried again
@code = (
q/1;/,
);
- TODO: {
- local $TODO = "Current load_optional_class cannot find PARs";
- $retval = eval { $schema->load_optional_class('VIRTUAL::PAR::PACKAGE') };
- ok( !$@, 'load_optional_class of a PAR module did not throw' );
- ok( $retval, 'PAR package "loaded"' );
- }
+ $retval = eval { $schema->load_optional_class('VIRTUAL::PAR::PACKAGE') };
+ ok( !$@, 'load_optional_class of a PAR module did not throw' );
+ ok( $retval, 'PAR package "loaded"' );
# see if we can still load stuff with the coderef present
$retval = eval { $schema->load_optional_class('DBIx::Class::ResultClass::HashRefInflator') };
{
# 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/,