Sha256: c187a7fc298d59a22ae39525be711c7d775f1aca5e81449d1b6310ee90969139

Contents?: true

Size: 1.31 KB

Versions: 3

Compression:

Stored size: 1.31 KB

Contents

require 'spec_helper'

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

  describe '#image_file?' do
    before do
      allow(subject).to receive(: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(: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(: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(: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(: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

3 entries across 3 versions & 1 rubygems

Version Path
geo_concerns-0.0.3 spec/models/concerns/geo_concerns/file_set/geo_file_format_behavior_spec.rb
geo_concerns-0.0.2 spec/models/concerns/geo_concerns/file_set/geo_file_format_behavior_spec.rb
geo_concerns-0.0.1 spec/models/concerns/geo_concerns/file_set/geo_file_format_behavior_spec.rb