Skip to content

Commit

Permalink
Split out git test initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
ferki committed Jan 18, 2025
1 parent 564f8b7 commit 1bad3b9
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions t/scm/git.t
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ set repository => $test_repo_name, url => $test_repo_dir;
subtest 'clone into non-existing directory', sub {
plan tests => 6;

my $clone_target_dir = tempdir( CLEANUP => 1 );
my $clone_target_dir = init_test();

ok( -d $clone_target_dir, "$clone_target_dir could be created" );

Expand All @@ -67,7 +67,7 @@ subtest 'clone into non-existing directory', sub {
subtest 'clone into existing directory', sub {
plan tests => 5;

my $clone_target_dir = tempdir( CLEANUP => 1 );
my $clone_target_dir = init_test();

ok( -d $clone_target_dir,
"$clone_target_dir is the clone target directory now" );
Expand Down Expand Up @@ -111,3 +111,9 @@ sub git_repo_ok {

return;
}

sub init_test {
my $clone_target_dir = tempdir( CLEANUP => 1 );

return $clone_target_dir;
}

0 comments on commit 1bad3b9

Please sign in to comment.