Bug 18959: Skip xt/author/Text_CSV_Various.t if Text::CSV::Unicode missing
authorTomas Cohen Arazi <tomascohen@theke.io>
Sat, 13 Oct 2018 12:17:00 +0000 (09:17 -0300)
committerFridolin Somers <fridolin.somers@biblibre.com>
Wed, 28 Nov 2018 08:34:02 +0000 (09:34 +0100)
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: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit ca9a1b76d8d729b1c09dbedbd90bd3f748351c4b)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 882e18500c0ace2a1df7ad7ad3e38ece865a2953)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>

xt/author/Text_CSV_Various.t

index f7f8ff9..23b1f91 100755 (executable)
 
 use Modern::Perl;
 
-use Test::More tests => 32;
+use Test::More;
 use Test::Warn;
+
+use Text::CSV;
+use Text::CSV_XS;
+
+use Module::Load::Conditional qw/check_install/;
+
 BEGIN {
-       use FindBin;
-       use lib $FindBin::Bin;
-       use_ok('Text::CSV');
-       use_ok('Text::CSV_XS');
-       use_ok('Text::CSV::Unicode');
+    if ( check_install( module => 'Text::CSV::Unicode' ) ) {
+        plan tests => 29;
+    } else {
+        plan skip_all => "Need Text::CSV::Unicode"
+    }
 }
 
+use Text::CSV::Unicode;
+
 sub pretty_line {
        my $max = 54;
        (@_) or return "#" x $max . "\n";