Sha256: 8431415ea90e1680b0a99f93b7a91476b20867e381dcdc00507f2efc46f9bc54
Contents?: true
Size: 1008 Bytes
Versions: 10
Compression:
Stored size: 1008 Bytes
Contents
require 'spec_helper' RSpec.describe GeoCombine::Metadata do include XmlDocs describe '#initialize' do it 'reads metadata from file if File is readable' do expect(File).to receive(:readable?).and_return(true) expect(File).to receive(:read).and_return(simple_xml) metadata_object = GeoCombine::Metadata.new('./tmp/fake/file/location') expect(metadata_object).to be_an GeoCombine::Metadata expect(metadata_object.metadata).to be_an Nokogiri::XML::Document expect(metadata_object.metadata.css('Author').count).to eq 2 end it 'reads metadata from parameter if File is not readable' do metadata_object = GeoCombine::Metadata.new(simple_xml) expect(metadata_object).to be_an GeoCombine::Metadata expect(metadata_object.metadata).to be_an Nokogiri::XML::Document expect(metadata_object.metadata.css('Author').count).to eq 2 end end # GeoCombine subclasses should individually test `to_geoblacklight` and # `to_html` methods end
Version data entries
10 entries across 10 versions & 1 rubygems