Lines 6-26
Link Here
|
6 |
use strict; |
6 |
use strict; |
7 |
use warnings; |
7 |
use warnings; |
8 |
|
8 |
|
9 |
use Test::More tests => 19; |
9 |
use Test::More tests => 21; |
10 |
|
10 |
|
11 |
BEGIN { |
11 |
BEGIN { |
12 |
use_ok('C4::Installer::PerlModules'); |
12 |
use_ok('C4::Installer::PerlModules'); |
13 |
} |
13 |
} |
14 |
|
14 |
|
15 |
$C4::Installer::PerlModules::PERL_DEPS->{'Local::Module::Sort'} = { |
15 |
$C4::Installer::PerlModules::PERL_DEPS->{'Local::Module::Upgraded'} = { |
16 |
'required' => '1', |
16 |
'required' => '1', |
17 |
'min_ver' => '0.9.3', |
17 |
'min_ver' => '0.9.3', |
18 |
'usage' => "Testing: make sure numbers are compared numerically and not lexicographically", |
18 |
'usage' => "Testing: make sure numbers are compared numerically and not lexicographically", |
19 |
}; |
19 |
}; |
|
|
20 |
$Local::Module::Upgraded::VERSION = '0.9.13'; |
21 |
$INC{"Local/Module/Upgraded.pm"} = 1; |
22 |
use_ok("Local::Module::Upgraded"); |
20 |
|
23 |
|
21 |
$Local::Module::Sort::VERSION = '0.9.13'; |
24 |
$C4::Installer::PerlModules::PERL_DEPS->{'Local::Module::NotUpgraded'} = { |
22 |
$INC{"Local/Module/Sort.pm"} = 1; |
25 |
'required' => '1', |
23 |
use_ok("Local::Module::Sort"); |
26 |
'min_ver' => '0.9.3', |
|
|
27 |
'usage' => "Testing: make sure numbers are compared numerically and not lexicographically", |
28 |
}; |
29 |
$Local::Module::NotUpgraded::VERSION = '0.9.1'; |
30 |
$INC{"Local/Module/NotUpgraded.pm"} = 1; |
31 |
use_ok("Local::Module::NotUpgraded"); |
24 |
|
32 |
|
25 |
my $modules; |
33 |
my $modules; |
26 |
ok ($modules = C4::Installer::PerlModules->new(), 'Tests modules object'); |
34 |
ok ($modules = C4::Installer::PerlModules->new(), 'Tests modules object'); |
Lines 48-51
ok (exists($params{"DBI"}), 'DBI exists in array');
Link Here
|
48 |
is ($modules->required('module'=>"String::Random"),1, 'String::Random should return 1 since required'); |
56 |
is ($modules->required('module'=>"String::Random"),1, 'String::Random should return 1 since required'); |
49 |
ok (!$modules->version_info(), "Testing empty modules"); |
57 |
ok (!$modules->version_info(), "Testing empty modules"); |
50 |
|
58 |
|
51 |
is($modules->version_info('module'=>"Local::Module::Sort")->{"Local::Module::Sort"}->{"upgrade"},0,"Version 0.9.13 is greater than 0.9.3, so no upgrade needed"); |
59 |
is($modules->version_info('module'=>"Local::Module::Upgraded")->{"Local::Module::Upgraded"}->{"upgrade"},0,"Version 0.9.13 is greater than 0.9.3, so no upgrade needed"); |
|
|
60 |
is($modules->version_info('module'=>"Local::Module::NotUpgraded")->{"Local::Module::NotUpgraded"}->{"upgrade"},1,"Version 0.9.1 is smaller than 0.9.1, so no upgrade needed"); |
52 |
- |
|
|