Skip to content

Commit

Permalink
satisfy the critics
Browse files Browse the repository at this point in the history
  • Loading branch information
gugod committed Jul 27, 2022
1 parent 5a66475 commit 1962e46
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions t/error-http_download-param-validation.t
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
use strict;
use warnings;
use Test::More;
use Test::Exception;
use File::Temp 'tempdir';
use File::Temp qw(tempdir);
use IO::All;

use App::Perlbrew::HTTP qw(http_user_agent_program http_get http_download);
use App::Perlbrew::HTTP qw(http_download);

subtest "http_download: dies when when the download target already exists" => sub {
my $dir = tempdir( CLEANUP => 1 );
my $dir = tempdir( CLEANUP => 1 );
my $output = "$dir/whatever";

io($output)->print("so");

my $error;
throws_ok {
$error = http_download("https://install.perlbrew.pl", $output);
} qr(^ERROR: The download target < \Q$output\E > already exists\.$);
$error = http_download( "https://install.perlbrew.pl", $output );
}
qr(^ERROR: The download target < \Q$output\E > already exists\.$);
};

done_testing;

0 comments on commit 1962e46

Please sign in to comment.