Koha/t/Installer_pm.t
Jonathan Druart 2b9662e0ca Bug 17990: Refactor Perl module versions check
The code is duplicated, variable are not set ($_), code is hard to read,
not covered by tests and the subroutine has 2 completely different
behaviors depending on the presence of the "module" parameter.
No need more ti rewrite it.

Test plan:
- Use koha_perl_deps.pl with the different options (-u -m -a -i)
- Go on the about page, "Perl modules" tab

You should not see any differences from before and after this patch

Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2017-02-17 12:13:44 +00:00

25 lines
457 B
Perl
Executable file

#!/usr/bin/perl
#
use strict;
use warnings;
use Test::More tests => 4;
use Data::Dumper;
BEGIN {
use_ok('C4::Installer::PerlModules');
}
my $obj = C4::Installer::PerlModules->new;
isa_ok($obj,'C4::Installer::PerlModules');
my $module_info = $obj->version_info('Test::More');
my $control = $Test::More::VERSION;
like($module_info->{cur_ver}, qr/\d/, 'returns numeric version');
is($module_info->{cur_ver}, $control, 'returns correct version');