#!perl use strict; use warnings; use Test::More; use Test::Exception; use Catmandu::Importer::MARC; use Catmandu::Fix; use utf8; my $pkg; BEGIN { $pkg = 'Catmandu::Fix::Condition::marc_has'; use_ok $pkg; } require_ok $pkg; my $fixes = <new(fixes => [$fixes]); my $importer = Catmandu::Importer::MARC->new( file => \$record, type => "ALEPHSEQ" ); my $records = $fixer->fix($importer)->to_array; my $errors = $records->[0]->{test}; is_deeply $errors , [ 'has 245' , 'has many CAT' , 'has many 920a' , 'has not more than one 100a' , ] , 'got the expected results'; done_testing;