Skip to content

Commit

Permalink
Destroy and recreate tmp dir on each test setup run.
Browse files Browse the repository at this point in the history
  • Loading branch information
oalders committed May 1, 2016
1 parent ca63dab commit e4af04d
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions t/00_setup.t
Expand Up @@ -22,7 +22,11 @@ use Test::More 0.96;
use Test::More 0.96 ();
use Test::Most;

# Ensure we're starting fresh
my $tmp_dir = tmp_dir();
$tmp_dir->rmtree;
$tmp_dir->mkpath;

ok( $tmp_dir->stat, "$tmp_dir exists for testing" );

my $server = MetaCPAN::TestServer->new;
Expand All @@ -31,14 +35,6 @@ $server->setup;
my $config = get_config();
$config->{es} = $server->es_client;

foreach my $test_dir ( $config->{cpan}, $config->{source_base} ) {
next unless $test_dir;
my $dir = dir($test_dir);
if ( -e $dir->absolute ) {
ok( $dir->rmtree, "remove old test dir: $dir" );
}
}

my $mod_faker = 'Module::Faker::Dist::WithPerl';
eval "require $mod_faker" or die $@; ## no critic (StringyEval)

Expand Down

0 comments on commit e4af04d

Please sign in to comment.