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

Version Path
geo_combine-0.5.1 spec/lib/geo_combine_spec.rb
geo_combine-0.5.0 spec/lib/geo_combine_spec.rb
geo_combine-0.4.0 spec/lib/geo_combine_spec.rb
geo_combine-0.3.1 spec/lib/geo_combine_spec.rb
geo_combine-0.3.0 spec/lib/geo_combine_spec.rb
geo_combine-0.2.0 spec/lib/geo_combine_spec.rb
geo_combine-0.1.0 spec/lib/geo_combine_spec.rb
geo_combine-0.0.5 spec/lib/geo_combine_spec.rb
geo_combine-0.0.4 spec/lib/geo_combine_spec.rb
geo_combine-0.0.3 spec/lib/geo_combine_spec.rb