Bugzilla – Attachment 11633 Details for
Bug 5327
Omnibus for unit tests required for all C4 modules
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Added unit tests to 'Installer_perlmodules'
0002-Added-tests-to-installer_perlmodules.patch (text/plain), 2.11 KB, created by
Bart Jorgensen
on 2012-08-16 05:45:32 UTC
(
hide
)
Description:
Added unit tests to 'Installer_perlmodules'
Filename:
MIME Type:
Creator:
Bart Jorgensen
Created:
2012-08-16 05:45:32 UTC
Size:
2.11 KB
patch
obsolete
>From 9527b201f871a5eee6bb65ebd91ec8bf68128dff Mon Sep 17 00:00:00 2001 >From: Bart Jorgensen <bart.tj@gmail.com> >Date: Thu, 16 Aug 2012 17:43:17 +1200 >Subject: [PATCH 2/2] Added tests to installer_perlmodules > >--- > t/Installer_PerlModules.t | 27 ++++++++++++++++++++++++++- > 1 file changed, 26 insertions(+), 1 deletion(-) > >diff --git a/t/Installer_PerlModules.t b/t/Installer_PerlModules.t >index 561d84c..8778fae 100755 >--- a/t/Installer_PerlModules.t >+++ b/t/Installer_PerlModules.t >@@ -6,9 +6,34 @@ > use strict; > use warnings; > >-use Test::More tests => 1; >+use Test::More tests => 15; > > BEGIN { > use_ok('C4::Installer::PerlModules'); > } > >+my $modules; >+ok ($modules = C4::Installer::PerlModules->new(), 'Tests modules object'); >+my $prereq_pm = $modules->prereq_pm(); >+ok (exists($prereq_pm->{"DBI"}), 'DBI required for installer to run'); >+ok (exists($prereq_pm->{"CGI"}), 'CGI required for installer to run' ); >+ok (exists($prereq_pm->{"YAML"}), 'YAML required for installer to run'); >+is ($modules->required('module'=>"DBI"),1, 'DBI should return 1 since required'); >+is ($modules->required('module'=>"thisdoesn'texist"),-1, 'string should return -1 since not in hash'); >+my $required = $modules->required('required'=>1); >+my %params = map { $_ => 1 } @$required; >+ok (exists($params{"DBI"}), 'DBI required for installer to run'); >+my $optional = $modules->required('optional'=>1); >+%params = map { $_ => 1 } @$optional; >+ok (exists($params{"Test::Strict"}), 'test::strict optional for installer to run'); >+is ($optional = $modules->required('spaghetti'=>1),-1, '-1 returned when parsing in unknown parameter'); >+my $version_info = $modules->version_info('module'=>"DBI"); >+ok (exists($version_info->{'DBI'}->{"required"}), 'required exists'); >+ok (exists($version_info->{'DBI'}->{"upgrade"}), 'upgrade exists'); >+is ($modules->version_info('module'=>"thisdoesn'texist"),-1, 'thisdoesntexist should return -1'); >+ok ($modules->module_count() >10 , 'count should be greater than 10'); >+my @module_list = $modules->module_list; >+%params = map { $_ => 1 } @module_list; >+ok (exists($params{"DBI"}), 'DBI exists in array'); >+ >+ >-- >1.7.9.5 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 5327
:
2716
|
2726
|
5485
|
6236
|
6237
|
6373
|
6560
|
6561
|
6562
|
6563
|
6613
|
6614
|
6616
|
6620
|
6621
|
6622
|
6643
|
6650
|
6655
|
6679
|
6681
|
6682
|
6683
|
6726
|
6727
|
6728
|
6729
|
6730
|
6731
|
6732
|
6795
|
6799
|
6805
|
6819
|
6826
|
6827
|
6828
|
6834
|
7179
|
7180
|
7181
|
7182
|
7183
|
7184
|
7185
|
7186
|
7187
|
7188
|
7189
|
7190
|
7191
|
7192
|
7194
|
7195
|
7203
|
7206
|
7208
|
7209
|
7220
|
7221
|
7222
|
7223
|
7224
|
7225
|
7226
|
7227
|
7228
|
7229
|
7230
|
7231
|
7232
|
7233
|
7234
|
7235
|
7236
|
7237
|
7238
|
7239
|
7240
|
7241
|
7242
|
7400
|
7402
|
7403
|
7405
|
7573
|
7592
|
7593
|
7594
|
9897
|
10234
|
10616
|
10656
|
10659
|
10660
|
10661
|
10680
|
11141
|
11186
|
11212
|
11213
|
11278
|
11279
|
11280
|
11281
|
11339
|
11340
|
11341
|
11440
|
11467
|
11469
|
11470
|
11471
|
11472
|
11473
|
11500
|
11503
|
11505
|
11506
|
11633
|
11762
|
11763
|
11764
|
11765
|
11846
|
11985
|
11993
|
12002
|
12003