Improve test coverage

This commit is contained in:
Duncan Ferguson 2017-12-27 13:44:31 +00:00
parent 5615bbc5b1
commit c807b52129
3 changed files with 113 additions and 5 deletions

View file

@ -22,7 +22,6 @@ use POSIX qw/:sys_wait_h strftime mkfifo/;
use File::Temp qw/:POSIX/;
use Fcntl;
use File::Basename;
use Module::Load;
use Net::hostent;
use Sys::Hostname;
use English;

View file

@ -5,6 +5,8 @@ use strict;
use Carp;
use App::ClusterSSH::L10N;
use Module::Load;
use Exception::Class (
'App::ClusterSSH::Exception',
'App::ClusterSSH::Exception::Config' => {
@ -154,7 +156,7 @@ sub options {
my ($self) = @_;
return $self->{parent}->{options}
if $self->{parent} && $self->{parent}->{options};
return undef;
return;
}
sub set_config {
@ -283,11 +285,13 @@ sub parent {
}
sub sort {
my ($self) = @_;
my $self = shift;
my $sort = sub { sort @_ };
return $sort unless defined $self->config()->{'use_natural_sort'};
return $sort
unless ref( $self->config() ) eq "HASH"
&& $self->config()->{'use_natural_sort'};
# if the user has asked for natural sorting we need to include an extra
# module