Skip to content

Commit

Permalink
password tests updated for latest changes
Browse files Browse the repository at this point in the history
  • Loading branch information
briandfoy committed Mar 19, 2024
1 parent b307f21 commit f740cb7
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions t/passwords.t
Expand Up @@ -19,38 +19,38 @@ my $release = $class->new;

$release->turn_debug_on;

{
subtest 'cpan_user not set' => sub {
my $output = capture_stderr { $release->check_for_passwords };
is(
$output,
"CPAN pass is \n",
"cpan_user is not set. Not looking for password\n",
"Debug output shows empty password when password unset"
);
}
);
};

{
subtest 'cpan_user not set' => sub {
$ENV{'CPAN_PASS'} = 's3cr3t';
my $output = capture_stderr { $release->check_for_passwords };
is( $release->config->cpan_pass,
undef, "Password is unset when cpan username is not set" );
is(
$output,
"CPAN pass is \n",
"cpan_user is not set. Not looking for password\n",
'Debug output shows unset password when cpan username is not set'
);
}
);
};

{
subtest 'cpan_user not set' => sub {
$ENV{'CPAN_PASS'} = 's3cr3t';
$release->config->set( 'cpan_user', 'BDFOY' );
my $output = capture_stderr { $release->check_for_passwords };
is( $release->config->cpan_pass,
's3cr3t', "Password is set when CPAN_PASS is set" );
is(
$output,
"CPAN pass is s3cr3t\n",
"Used get_env_var to get CPAN_PASS\nCPAN pass is s3cr3t\n",
'Debug output shows password when set'
);
}
);
};

done_testing();

0 comments on commit f740cb7

Please sign in to comment.