From: Mark Tompsett <[email protected]>

TEST PLAN
---------
1) prove t/Prices.t
   -- failure
2) apply patch
3) prove t/Prices.t
   -- nicely skipped when Test::DBIx::Class is not available.

Signed-off-by: Srdjan <[email protected]>
---
 t/Prices.t | 20 ++++++++++++++------
 1 file changed, 14 insertions(+), 6 deletions(-)

diff --git a/t/Prices.t b/t/Prices.t
index d6bfda2..74d2eac 100644
--- a/t/Prices.t
+++ b/t/Prices.t
@@ -1,15 +1,23 @@
 use Modern::Perl;
-use Test::More tests => 17;
+use Test::More;
 use Test::MockModule;
 
 use t::lib::Mocks;
 
+use Module::Load::Conditional qw/check_install/;
+
 BEGIN {
-    use_ok('C4::Acquisition');
-    use_ok('C4::Bookseller');
-    use_ok('C4::Context');
-    use_ok('Koha::Number::Price');
-};
+    if ( check_install( module => 'Test::DBIx::Class' ) ) {
+        plan tests => 17;
+    } else {
+        plan skip_all => "Need Test::DBIx::Class"
+    }
+}
+
+use_ok('C4::Acquisition');
+use_ok('C4::Bookseller');
+use_ok('C4::Context');
+use_ok('Koha::Number::Price');
 
 t::lib::Mocks::mock_preference( 'gist', '0.02|0.05|0.196' );
 
-- 
2.7.4
_______________________________________________
Koha-patches mailing list
[email protected]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-patches
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to