Skip to content

Commit

Permalink
Merge pull request #4 from skozawa/master
Browse files Browse the repository at this point in the history
load preparer to call my_cnf method
  • Loading branch information
mackee committed Jan 11, 2017
2 parents 0bb12fe + 59b8993 commit 9ef07d4
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 9ef07d4

Please sign in to comment.