skip empty results of hash_filter
[Biblio-Isis] / t / 002_isis.t
index 6594491..72f0398 100755 (executable)
@@ -6,16 +6,21 @@ use blib;
 use Data::Dumper;
 
 use Test::More tests => 110;
+use File::Spec;
 
-BEGIN { use_ok( 'IsisDB' ); }
+BEGIN { use_ok( 'Biblio::Isis' ); }
 
+my $debug = shift @ARGV;
 my $isis;
 
+my $path_winisis = File::Spec->catfile('data', 'winisis', 'BIBL');
+my $path_isismarc = File::Spec->catfile('data', 'isismarc', 'BIBL');
+
 sub test_data {
 
        my $args = {@_};
 
-       isa_ok ($isis, 'IsisDB');
+       isa_ok ($isis, 'Biblio::Isis');
 
        cmp_ok($isis->count, '==', 5, "count is 5");
 
@@ -121,9 +126,10 @@ sub test_data {
 
 }
 
-$isis = IsisDB->new (
-       isisdb => './data/winisis/BIBL',
+$isis = Biblio::Isis->new (
+       isisdb => $path_winisis,
        include_deleted => 1,
+       debug => $debug,
 );
 
 print Dumper($isis);
@@ -139,8 +145,8 @@ test_data(
        ) ],
 );
 
-$isis = IsisDB->new (
-       isisdb => './data/isismarc/BIBL',
+$isis = Biblio::Isis->new (
+       isisdb => $path_isismarc,
        include_deleted => 1,
 );
 
@@ -156,16 +162,17 @@ test_data(
 
 # check logically deleted
 
-$isis = IsisDB->new (
-       isisdb => './data/winisis/BIBL',
+$isis = Biblio::Isis->new (
+       isisdb => $path_winisis,
        include_deleted => 1,
 );
 
 ok($isis->fetch(3), "deleted found");
 cmp_ok($isis->{deleted}, '==', 3, "MFN 3 is deleted");
 
-$isis = IsisDB->new (
-       isisdb => './data/winisis/BIBL',
+$isis = Biblio::Isis->new (
+       isisdb => $path_winisis,
+       debug => $debug,
 );
 
 ok(! $isis->fetch(3), "deleted not found");