Skip to content

Commit

Permalink
adding more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
garu committed Apr 23, 2016
1 parent 331647d commit 4b11bad
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/CPAN/Testers/Common/Client/Config.pm
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ sub _config_data {

sub _config_data_for {
my ($self, $type, $grade) = @_;
my %spec = $self->config_spec;
my %spec = $self->_config_spec;
my $data = exists $self->{_config}{$type} ? $self->{_config}{$type} : q();

my $dispatch = $spec{$type}{validate}->(
Expand Down
10 changes: 9 additions & 1 deletion t/02-config.t
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ is_deeply(
my $td = tempdir(File::Spec->catdir('t', 'cf XXXX'), CLEANUP => 1);
to_file(File::Spec->catfile($td, 'config.ini'), <<'EOF');
edit_report=default:ask/no pass/na:no
email_from=bogus@cpan.org
email_from=Some User (SOMEUSER) <bogus@cpan.org>
send_report=default:ask/yes pass/na:yes
transport=Metabase uri https://metabase.cpantesters.org/api/v1/ id_file metabase_id.json
EOF
Expand Down Expand Up @@ -84,6 +84,14 @@ for my $method (qw(myprompt mywarn myprint read)) {
is $@, '', $method;
}

is(
$config->email_from,
'Some User (SOMEUSER) <bogus@cpan.org>',
'got the right email_from'
);

is $config->transport_name, 'Metabase', 'found right transport name';

my %args = @{ $config->transport_args };
is_deeply \%args, {
'uri',
Expand Down

0 comments on commit 4b11bad

Please sign in to comment.