Bug 18243: 16034 follow-up: better handling of absence of WebService::ILS::OverDrive...
authorSrdjan <srdjan@catalyst.net.nz>
Thu, 2 Mar 2017 00:31:14 +0000 (13:31 +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::OverDrive::Patron
installed
2 - prove t/Koha_ExternalContent_OverDrive.t
3 - You should get a failure to load module and tests are skipped
4 - Apply patch
5 - prove t/Koha_ExternalContent_OverDrive.t
6 - Module is not loaded, test are skipped

Fixed small typo 'cannot filnd' -> 'cannot find'
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
t/Koha_ExternalContent_OverDrive.t

index de70b3d..5d2486f 100755 (executable)
@@ -3,11 +3,11 @@ use Modern::Perl;
 use t::lib::Mocks;
 use Test::More tests => 5;                      # last test to print
 
-local $@;
-eval { require WebService::ILS::OverDrive::Patron; }
-  or diag($@);
+use Module::Load::Conditional qw( can_load );
+
 SKIP: {
-    skip "cannot filnd WebService::ILS::OverDrive::Patron", 5 if $@;
+    skip "cannot find WebService::ILS::OverDrive::Patron", 5
+      unless can_load( modules => { 'WebService::ILS::OverDrive::Patron' => undef } );
 
     use_ok('Koha::ExternalContent::OverDrive');