Sha256: 061367f36f17882f0db2e9a22f274fa7be33b599409e46236127f8cca73f82ce

Contents?: true

Size: 1.3 KB

Versions: 6

Compression:

Stored size: 1.3 KB

Contents

require 'spec_helper'

describe GeoWorks::Processors::Raster::Processor do
  subject { described_class.new(file_name, directives) }
  let(:processor) { double }

  context 'when a usgs ascii dem format type is passed' do
    let(:file_name) { 'files/geo.dem' }
    let(:directives) { { input_format: 'text/plain; gdal-format=USGSDEM' } }

    it 'calls the DEM processor' do
      expect(GeoWorks::Processors::Raster::Dem).to receive(:new).and_return(processor)
      expect(processor).to receive(:process)
      subject.process
    end
  end

  context 'when an Arc/Info Binary Grid format type is passed' do
    let(:file_name) { 'files/aig.zip' }
    let(:directives) { { input_format: 'application/octet-stream; gdal-format=AIG' } }

    it 'calls the AIG processor' do
      expect(GeoWorks::Processors::Raster::Aig).to receive(:new).and_return(processor)
      expect(processor).to receive(:process)
      subject.process
    end
  end

  context 'when a GeoTIFF format type is passed' do
    let(:file_name) { 'files/geo.tif' }
    let(:directives) { { input_format: 'image/tiff; gdal-format=GTiff' } }

    it 'calls the base raster processor' do
      expect(GeoWorks::Processors::Raster::Base).to receive(:new).and_return(processor)
      expect(processor).to receive(:process)
      subject.process
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
geo_works-0.2.0 spec/processors/geo_works/processors/raster/processor_spec.rb
geo_works-0.1.4 spec/processors/geo_works/processors/raster/processor_spec.rb
geo_works-0.1.3 spec/processors/geo_works/processors/raster/processor_spec.rb
geo_works-0.1.2 spec/processors/geo_works/processors/raster/processor_spec.rb
geo_works-0.1.1 spec/processors/geo_works/processors/raster/processor_spec.rb
geo_works-0.1.0 spec/processors/geo_works/processors/raster/processor_spec.rb