diff --git a/spec/fixed_fields/book_bad_008_spec.rb b/spec/fixed_fields/book_bad_008_spec.rb new file mode 100644 index 0000000..b14f46e --- /dev/null +++ b/spec/fixed_fields/book_bad_008_spec.rb @@ -0,0 +1,15 @@ +require 'nokogiri' +require 'marc' +require 'byebug' +require 'marc_cleanup' + +RSpec.describe 'test bad_008?' do + describe 'bad book format 008' do + let(:marcfile) {"#{Dir.getwd}/spec/fixtures/fixed_fields/marc_with_bad_book_008.xml"} + let(:reader) { MARC::XMLReader.new(marcfile, parser: 'magic') } + let(:record_with_bad_008) { reader.first } + it 'knows that a record with bad book 008 is invalid' do + expect(MarcCleanup.bad_008?(record_with_bad_008)).to eq true + end + end +end \ No newline at end of file diff --git a/spec/fixtures/fixed_fields/marc_with_bad_book_008.xml b/spec/fixtures/fixed_fields/marc_with_bad_book_008.xml new file mode 100644 index 0000000..5fa546a --- /dev/null +++ b/spec/fixtures/fixed_fields/marc_with_bad_book_008.xml @@ -0,0 +1,14 @@ + + + + 01104naa a2200289 i 4500 + 99127156537506421 + 230519s1996 njua u 000 0 eng d + + PPPL highlights : + Princeton Plasma Physics Laboratory. + + + \ No newline at end of file