Sha256: 5934bf705cda19d23fd11452080078e18217a502265a891c88628293a9792665

Contents?: true

Size: 1.18 KB

Versions: 5

Compression:

Stored size: 1.18 KB

Contents

require 'spec_helper'

describe Geoblacklight::Reference do
  let(:typical_reference) do
    Geoblacklight::Reference.new(['http://www.opengis.net/def/serviceType/ogc/wms', 'http://hgl.harvard.edu:8080/geoserver/wms'])
  end
  let(:blank_reference) do
    Geoblacklight::Reference.new([])
  end
  describe '#initialize' do
    it 'instance variable reference is set' do
      expect(typical_reference.instance_variable_get(:@reference)).to eq ['http://www.opengis.net/def/serviceType/ogc/wms', 'http://hgl.harvard.edu:8080/geoserver/wms']
    end
  end
  describe '#endpoint' do
    it 'returns the endpoint url for a reference' do
      expect(typical_reference.endpoint).to eq 'http://hgl.harvard.edu:8080/geoserver/wms'
    end
    it 'returns nil for a blank reference' do
      expect(blank_reference.endpoint).to be_nil
    end
  end
  describe '#type' do
    it 'looks up a constant using the uri' do
      expect(typical_reference.type).to eq :wms
      expect(blank_reference.type).to be_nil
    end
  end
  describe '#to_hash' do
    it 'creates a hash using type and endpoint' do
      expect(typical_reference.to_hash).to eq :wms => 'http://hgl.harvard.edu:8080/geoserver/wms'
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
geoblacklight-0.11.1 spec/lib/geoblacklight/reference_spec.rb
geoblacklight-0.11.0 spec/lib/geoblacklight/reference_spec.rb
geoblacklight-0.10.2 spec/lib/geoblacklight/reference_spec.rb
geoblacklight-0.10.1 spec/lib/geoblacklight/reference_spec.rb
geoblacklight-0.10.0 spec/lib/geoblacklight/reference_spec.rb