Bug 7702: [SIGNED-OFF] MARC21 heading tests should not run under UNIMARC
authorJared Camins-Esakov <jcamins@cpbibliography.com>
Sun, 11 Mar 2012 16:57:11 +0000 (12:57 -0400)
committerPaul Poulain <paul.poulain@biblibre.com>
Mon, 26 Mar 2012 13:53:01 +0000 (15:53 +0200)
Skip the MARC21-specific tests in t/Heading_MARC21.t if the marcflavour is
UNIMARC.

Signed-off-by: Magnus Enger <magnus@enger.priv.no>
I set marcflavour = UNIMARC for testing this.
Before the patch, t/Heading_MARC21.t fails. After the patch it
succeeds.

Signed-off-by: Magnus Enger <magnus@enger.priv.no>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
t/Heading_MARC21.t

index 198eaea..0e1f1c9 100755 (executable)
@@ -7,12 +7,16 @@ use strict;
 use warnings;
 
 use Test::More tests => 3;
+use C4::Context;
 
 BEGIN {
         use_ok('C4::Heading');
 }
 
-my $field = MARC::Field->new( '650', ' ', '0', a => 'Uncles', x => 'Fiction' );
-my $heading = C4::Heading->new_from_bib_field($field);
-is($heading->display_form(), 'Uncles--Fiction', 'Display form generation');
-is($heading->search_form(), 'Uncles generalsubdiv Fiction', 'Search form generation');
+SKIP: {
+    skip "MARC21 heading tests not applicable to UNIMARC", 2 if C4::Context->preference('marcflavour') eq 'UNIMARC';
+    my $field = MARC::Field->new( '650', ' ', '0', a => 'Uncles', x => 'Fiction' );
+    my $heading = C4::Heading->new_from_bib_field($field);
+    is($heading->display_form(), 'Uncles--Fiction', 'Display form generation');
+    is($heading->search_form(), 'Uncles generalsubdiv Fiction', 'Search form generation');
+}