correctly skip tests if there is no test MARC file
authorDobrica Pavlinusic <dpavlin@rot13.org>
Mon, 29 Oct 2007 22:41:21 +0000 (22:41 +0000)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Mon, 29 Oct 2007 22:41:21 +0000 (22:41 +0000)
git-svn-id: svn+ssh://llin/home/dpavlin/private/svn/MARC-Fast/trunk@21 49f9634a-d7ec-0310-8e6b-ec35c6cc8804

t/001_marc.t

index 990d078..5090234 100755 (executable)
@@ -11,6 +11,9 @@ BEGIN {
 }
 
 my $debug = shift @ARGV;
+
+my $marc_file = 't/camel.usmarc';
+
 if ( $debug ) {
        eval { require Data::Dump; };
        $debug = 0 if ($@);
@@ -25,11 +28,13 @@ $param{marcdb} = '/foo/bar/file';
 
 throws_ok { $marc = MARC::Fast->new(%param); } qr/foo.bar/, "marcdb exist";
 
-$param{marcdb} = 'data/unimarc.iso';
+$param{marcdb} = $marc_file if -e $marc_file;
 
 SKIP: {
        skip "no $param{marcdb} test file ", 37 unless (-e $param{marcdb});
 
+       diag "marc file: $marc_file";
+
        ok($marc = MARC::Fast->new(%param), "new");
 
        isa_ok ($marc, 'MARC::Fast');