| 1 |
#!perl |
| 2 |
|
| 3 |
use strict; |
| 4 |
use warnings; |
| 5 |
use Test::More; |
| 6 |
use Test::Exception; |
| 7 |
use Catmandu::Importer::MARC; |
| 8 |
|
| 9 |
my $pkg; |
| 10 |
|
| 11 |
BEGIN { |
| 12 |
$pkg = 'Catmandu::Importer::MARC::MARCMaker'; |
| 13 |
use_ok $pkg; |
| 14 |
} |
| 15 |
|
| 16 |
require_ok $pkg; |
| 17 |
|
| 18 |
my $importer = Catmandu::Importer::MARC->new(file => 't/camel.mrk', type => 'MARCMaker'); |
| 19 |
|
| 20 |
ok $importer , 'got an MARC/MARCMaker importer'; |
| 21 |
|
| 22 |
my $records = $importer->to_array; |
| 23 |
|
| 24 |
ok(@$records == 10); |
| 25 |
|
| 26 |
is($records->[0]->{record}->[1]->[4] , 'fol05731351 '); |
| 27 |
|
| 28 |
is($records->[0]->{record}->[11]->[4] , 'Martinsson, Tobias,'); |
| 29 |
|
| 30 |
done_testing; |