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