Sha256: ce0302912322120528d41fb27800af22d47377c868a5bdab5f0e2d8f9ea90eaa

Contents?: true

Size: 1.33 KB

Versions: 15

Compression:

Stored size: 1.33 KB

Contents

require 'spec_helper'

describe GeoConcerns::GeoFileFormatBehavior do
  subject { FileSet.new }

  describe '#image_file?' do
    before do
      allow(subject).to receive(:geo_mime_type).and_return('image/tiff')
    end
    it 'is true' do
      expect(subject.image_file?).to be true
    end
  end

  describe '#raster_file?' do
    before do
      allow(subject).to receive(:geo_mime_type).and_return('image/tiff; gdal-format=GTiff')
    end
    it 'is true' do
      expect(subject.raster_file?).to be true
    end
  end

  describe '#vector_file?' do
    before do
      allow(subject).to receive(:geo_mime_type).and_return('application/zip; ogr-format="ESRI Shapefile"')
    end
    it 'is true' do
      expect(subject.vector_file?).to be true
    end
  end

  describe '#external_metadata_file?' do
    before do
      allow(subject).to receive(:geo_mime_type).and_return('application/xml; schema=iso19139')
    end
    it 'is true' do
      expect(subject.external_metadata_file?).to be true
    end
  end

  describe '#geo_file_format?' do
    before do
      allow(subject).to receive(:geo_mime_type).and_return('image/tiff; gdal-format=GTiff')
    end
    it 'is true' do
      expect(subject.geo_file_format?).to be true
    end
  end

  describe '#image_work?' do
    it 'is false' do
      expect(subject.image_work?).to be false
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
geo_concerns-0.3.4 spec/models/concerns/geo_concerns/file_set/geo_file_format_behavior_spec.rb
geo_concerns-0.3.3 spec/models/concerns/geo_concerns/file_set/geo_file_format_behavior_spec.rb
geo_concerns-0.3.2 spec/models/concerns/geo_concerns/file_set/geo_file_format_behavior_spec.rb
geo_concerns-0.3.1 spec/models/concerns/geo_concerns/file_set/geo_file_format_behavior_spec.rb
geo_concerns-0.3.0 spec/models/concerns/geo_concerns/file_set/geo_file_format_behavior_spec.rb
geo_concerns-0.2.0 spec/models/concerns/geo_concerns/file_set/geo_file_format_behavior_spec.rb
geo_concerns-0.1.1 spec/models/concerns/geo_concerns/file_set/geo_file_format_behavior_spec.rb
geo_concerns-0.1.0 spec/models/concerns/geo_concerns/file_set/geo_file_format_behavior_spec.rb
geo_concerns-0.0.10 spec/models/concerns/geo_concerns/file_set/geo_file_format_behavior_spec.rb
geo_concerns-0.0.9 spec/models/concerns/geo_concerns/file_set/geo_file_format_behavior_spec.rb
geo_concerns-0.0.8 spec/models/concerns/geo_concerns/file_set/geo_file_format_behavior_spec.rb
geo_concerns-0.0.7 spec/models/concerns/geo_concerns/file_set/geo_file_format_behavior_spec.rb
geo_concerns-0.0.6 spec/models/concerns/geo_concerns/file_set/geo_file_format_behavior_spec.rb
geo_concerns-0.0.5 spec/models/concerns/geo_concerns/file_set/geo_file_format_behavior_spec.rb
geo_concerns-0.0.4 spec/models/concerns/geo_concerns/file_set/geo_file_format_behavior_spec.rb