Sha256: 7a6f4343d3b0f266721061806069b58c4ca8e915662460c05dcb74d14e5e0a05

Contents?: true

Size: 1.33 KB

Versions: 6

Compression:

Stored size: 1.33 KB

Contents

require 'spec_helper'

describe GeoWorks::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

6 entries across 6 versions & 1 rubygems

Version Path
geo_works-0.2.0 spec/models/concerns/geo_works/file_set/geo_file_format_behavior_spec.rb
geo_works-0.1.4 spec/models/concerns/geo_works/file_set/geo_file_format_behavior_spec.rb
geo_works-0.1.3 spec/models/concerns/geo_works/file_set/geo_file_format_behavior_spec.rb
geo_works-0.1.2 spec/models/concerns/geo_works/file_set/geo_file_format_behavior_spec.rb
geo_works-0.1.1 spec/models/concerns/geo_works/file_set/geo_file_format_behavior_spec.rb
geo_works-0.1.0 spec/models/concerns/geo_works/file_set/geo_file_format_behavior_spec.rb