X-Git-Url: http://git.equinoxoli.org/?p=migration-tools.git;a=blobdiff_plain;f=Equinox-Migration%2Ft%2F03-MapDrivenMARCXMLProc.t;h=c3e3ba00a7ea588f52f868d81fab7239abf45306;hp=3c3540cdcde867b2d9e6eadfeebed43307e612f8;hb=93facadd2821eba167e9dd7e4348b772e3d31337;hpb=7aac50486bbeb86e38be6676b8c4dd0b891f7023 diff --git a/Equinox-Migration/t/03-MapDrivenMARCXMLProc.t b/Equinox-Migration/t/03-MapDrivenMARCXMLProc.t index 3c3540c..c3e3ba0 100644 --- a/Equinox-Migration/t/03-MapDrivenMARCXMLProc.t +++ b/Equinox-Migration/t/03-MapDrivenMARCXMLProc.t @@ -2,9 +2,27 @@ #use Test::More tests => 39; use Test::More qw(no_plan); -use Equinox::Migration::MapDrivenXMLProc; +use Equinox::Migration::MapDrivenMARCXMLProc; + +# fails +eval { my $mp = + Equinox::Migration::MapDrivenMARCXMLProc->new(marcfile => 't/corpus/mdmp-0.txt') }; +is ($@, "Argument 'mapfile' must be specified\n", 'no mapfile'); + +eval { my $mp = + Equinox::Migration::MapDrivenMARCXMLProc->new(mapfile => 't/corpus/mdmpmap-00.txt') }; +is ($@, "Argument 'marcfile' must be specified\n", 'no marcfile'); + +eval { my $mp = Equinox::Migration::MapDrivenMARCXMLProc->new }; +is ($@, "Argument 'mapfile' must be specified\n", 'no mapfile'); + # baseline object creation -my $sm = Equinox::Migration::MapDrivenXMLProc->new(); -is(ref $sm, "Equinox::Migration::MapDrivenXMLProc", "self is self"); +my $mp = Equinox::Migration::MapDrivenMARCXMLProc->new( marcfile => 't/corpus/mdmp-0.txt', + mapfile => 't/corpus/mdmpmap-00.txt', + ); +is(ref $mp, "Equinox::Migration::MapDrivenMARCXMLProc", "self is self"); +# parsing +my $rec = $mp->parse_record; +is (defined $rec, 1);