From 2908568e3d5cbbae3ae26230f2c56d8b0b2ee24e Mon Sep 17 00:00:00 2001 From: Dobrica Pavlinusic Date: Mon, 29 Oct 2007 22:41:21 +0000 Subject: [PATCH] correctly skip tests if there is no test MARC file git-svn-id: svn+ssh://llin/home/dpavlin/private/svn/MARC-Fast/trunk@21 49f9634a-d7ec-0310-8e6b-ec35c6cc8804 --- t/001_marc.t | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/t/001_marc.t b/t/001_marc.t index 990d078..5090234 100755 --- a/t/001_marc.t +++ b/t/001_marc.t @@ -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'); -- 2.20.1