Sha256: dbb6fef7c435b00d009115d45ccc3acc772f2d1228c7bdbe0383b8db169f9025

Contents?: true

Size: 1.1 KB

Versions: 4

Compression:

Stored size: 1.1 KB

Contents

require 'spec_helper'

describe Geoblacklight::Metadata do
  describe '.instance' do
    let(:reference) { instance_double(Geoblacklight::Reference) }
    context 'with an FGDC metadata reference' do
      before do
        allow(reference).to receive(:type).and_return('fgdc')
      end
      it 'constructs an Geoblacklight::Metadata::Fgdc instance' do
        expect(described_class.instance(reference)).to be_a Geoblacklight::Metadata::Fgdc
      end
    end

    context 'with an ISO19139 metadata reference' do
      before do
        allow(reference).to receive(:type).and_return('iso19139')
      end
      it 'constructs an Geoblacklight::Metadata::Iso19139 instance' do
        expect(described_class.instance(reference)).to be_a Geoblacklight::Metadata::Iso19139
      end
    end

    context 'with another metadata reference' do
      before do
        allow(reference).to receive(:type).and_return('unsupported')
      end
      it 'constructs an Geoblacklight::Metadata::Base instance' do
        expect(described_class.instance(reference)).to be_a Geoblacklight::Metadata::Base
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
geoblacklight-1.8.0 spec/lib/geoblacklight/metadata_spec.rb
geoblacklight-1.7.1 spec/lib/geoblacklight/metadata_spec.rb
geoblacklight-1.7.0 spec/lib/geoblacklight/metadata_spec.rb
geoblacklight-1.6.0 spec/lib/geoblacklight/metadata_spec.rb