From 27243e4bedcef3c5a319a1cd6bd376426c44f98a Mon Sep 17 00:00:00 2001 From: Lee Jamison Date: Wed, 5 Jul 2017 18:01:57 +0000 Subject: [PATCH] Bug 18897 - Koha_Elasticsearch_Indexer.t doesn't skip when ES module not installed If Catmandu::Importer::MARC is not installed, Koha_Elasticsearch_Indexer.t fails instead of skipping. Test Plan: 1. Run "prove t/db_dependent/Koha_Elasticsearch_Indexer.t" as koha-shell. 2. Note failure on test 1/5 indicating module not installed. 3. Apply patch. 4. Re-run "prove t/db_dependent/Koha_Elasticsearch_Indexer.t" 5. Note test now skips. --- t/db_dependent/Koha_Elasticsearch_Indexer.t | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/t/db_dependent/Koha_Elasticsearch_Indexer.t b/t/db_dependent/Koha_Elasticsearch_Indexer.t index 04a8e2a..dfe7777 100644 --- a/t/db_dependent/Koha_Elasticsearch_Indexer.t +++ b/t/db_dependent/Koha_Elasticsearch_Indexer.t @@ -17,11 +17,20 @@ use Modern::Perl; -use Test::More tests => 5; +use Test::More; use MARC::Record; -use_ok('Koha::SearchEngine::Elasticsearch::Indexer'); +eval { require Koha::SearchEngine::Elasticsearch::Indexer; }; + +if ( $@ ) { + my $es_dep_msg = 'Required module Catmandu::Importer::MARC is not installed'; + plan( skip_all => $es_dep_msg ); +} +else { + plan tests => 5; + use_ok('Koha::SearchEngine::Elasticsearch::Indexer'); +} my $indexer; ok( -- 2.1.4