Bug 18243: 16034 follow-up: Conditionally test Koha::ExternalContent::* modules loading
authorSrdjan <srdjan@catalyst.net.nz>
Mon, 13 Mar 2017 23:24:42 +0000 (12:24 +1300)
committerKyle M Hall <kyle@bywatersolutions.com>
Mon, 20 Mar 2017 15:28:35 +0000 (15:28 +0000)
To test:
1 - Make sure you don't have WebService::ILS installed
2 - prove t/00-load.t
3 - You should get a failure to load module and tests are skipped
4 - Apply patch
5 - prove t/00-load.t
6 - Module is not loaded, test are skipped
Optional:
7 - Install WebService::ILS
5 - prove t/00-load.t
6 - Module is loaded, test passes

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
t/00-load.t

index 6c8b838..36a5bcf 100644 (file)
@@ -89,6 +89,9 @@ sub is_testable {
     elsif ( $module_name =~ /Koha::SearchEngine::Elasticsearch::Search/xsm ) {
         @needed_module_names = ( 'Catmandu::Store::ElasticSearch' );
     }
+    elsif ( $module_name =~ /^Koha::ExternalContent/xsm ) {
+        @needed_module_names = ( 'WebService::ILS' );
+    }
     foreach my $current_name (@needed_module_names) {
         my $relative_pathname = $current_name;
         $relative_pathname =~ s/::/\//gxsm;