Skip to content

Commit

Permalink
load preparer to call my_cnf method
Browse files Browse the repository at this point in the history
  • Loading branch information
skozawa committed Jan 10, 2017
1 parent 0bb12fe commit 59b8993
Showing 1 changed file with 12 additions and 14 deletions.
26 changes: 12 additions & 14 deletions lib/App/Prove/Plugin/MySQLPool.pm
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,18 @@ sub load {
my $pool = Test::mysqld::Pool->new(
jobs => $jobs,
share_file => $share_file->filename,
($preparer ? (
preparer => sub {
my ($mysqld) = @_;

push( @INC, 'lib' )
if $lib;

eval "require $preparer" ## no critic
or die "$@";

$preparer->prepare( $mysqld );
},
$preparer->can('my_cnf') ? ( my_cnf => $preparer->my_cnf ) : (),
) : ()),
($preparer ? do {
push( @INC, 'lib' ) if $lib;
eval "require $preparer" ## no critic
or die "$@";
(
preparer => sub {
my ($mysqld) = @_;
$preparer->prepare( $mysqld );
},
$preparer->can('my_cnf') ? ( my_cnf => $preparer->my_cnf ) : (),
)
} : ()),
);
$pool->prepare;

Expand Down

0 comments on commit 59b8993

Please sign in to comment.