require 'spec_helper' module Exlibris module Aleph class Holding describe Metadata do let(:marc_xml) { %Q{ cxH a22001092 4500 002367980 NYUb12672786 20080531131729.0 0510170|||||8 |001|||||0051017 2002030296 0810844915 (alk. paper) NYUH12672786/13890243 NNCoo CU MAIN HN90.I56 K888 2003 31206028778120 13890243 }} subject(:metadata) { Metadata.new(marc_xml) } describe '#marc_xml' do subject { metadata.marc_xml } it { should eq marc_xml.strip.gsub('holding>', 'record>') } end describe '#marc_record' do subject { metadata.marc_record } it { should be_a MARC::Record } end describe '#location' do subject { metadata.location } it { should be_a MARC::DataField } end describe '#sub_location' do subject { metadata.sub_location } it { should eq 'CU' } end describe '#shelving_location' do subject { metadata.shelving_location } it { should eq 'MAIN' } end end end end end