clean output dir after testing

This commit is contained in:
2015-04-12 01:45:17 +01:00
parent 1e20fb7c0e
commit ea8526beb2
3 changed files with 10 additions and 2 deletions

View File

@@ -20,6 +20,7 @@ CSS::Minifier::XS = 0
[GatherDir] [GatherDir]
include_dotfiles = 1 include_dotfiles = 1
exclude_match = t/public
[PruneCruft] [PruneCruft]

View File

@@ -238,8 +238,7 @@ sub copy_files {
my $aggregate_digest = $self->full_digest->hexdigest; my $aggregate_digest = $self->full_digest->hexdigest;
my $output_path = Path::Class::Dir->new( $self->output_path ); $self->clean_output();
$output_path->rmtree();
$l->info( 'Copying ', $self->asset_cache_count, ' files', ); $l->info( 'Copying ', $self->asset_cache_count, ' files', );
for my $value ( $self->asset_cache_values ) { for my $value ( $self->asset_cache_values ) {
@@ -248,6 +247,13 @@ sub copy_files {
return; return;
} }
sub clean_output {
my $self = shift;
my $output_path = Path::Class::Dir->new( $self->output_path );
$output_path->rmtree();
return;
}
sub _process_file { sub _process_file {
my $self = shift; my $self = shift;
my $asset = shift; my $asset = shift;

View File

@@ -40,6 +40,7 @@ for my $key ( keys %expected_result ) {
} }
} }
$fap->clean_output();
done_testing(); done_testing();
sub expected_result { sub expected_result {