Sha256: 6597a74740cb53d394aee5ae98fbbeac48f2702f2042f6b5a6c36fcbaab1fe0d

Contents?: true

Size: 960 Bytes

Versions: 18

Compression:

Stored size: 960 Bytes

Contents

require 'spec_helper'

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

  context 'when a shapefile format type is passed' do
    let(:file_name) { 'files/shapefile.zip' }
    let(:directives) { { input_format: 'application/zip; ogr-format="ESRI Shapefile"' } }

    it 'calls the shapefile processor' do
      expect(GeoConcerns::Processors::Vector::Shapefile).to receive(:new).and_return(processor)
      expect(processor).to receive(:process)
      subject.process
    end
  end

  context 'when a geojson format type is passed' do
    let(:file_name) { 'files/geo.json' }
    let(:directives) { { input_format: 'application/vnd.geo+json' } }

    it 'calls the base vector processor' do
      expect(GeoConcerns::Processors::Vector::Base).to receive(:new).and_return(processor)
      expect(processor).to receive(:process)
      subject.process
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
geo_concerns-0.3.4 spec/processors/geo_concerns/processors/vector/processor_spec.rb
geo_concerns-0.3.3 spec/processors/geo_concerns/processors/vector/processor_spec.rb
geo_concerns-0.3.2 spec/processors/geo_concerns/processors/vector/processor_spec.rb
geo_concerns-0.3.1 spec/processors/geo_concerns/processors/vector/processor_spec.rb
geo_concerns-0.3.0 spec/processors/geo_concerns/processors/vector/processor_spec.rb
geo_concerns-0.2.0 spec/processors/geo_concerns/processors/vector/processor_spec.rb
geo_concerns-0.1.1 spec/processors/geo_concerns/processors/vector/processor_spec.rb
geo_concerns-0.1.0 spec/processors/geo_concerns/processors/vector/processor_spec.rb
geo_concerns-0.0.10 spec/processors/geo_concerns/processors/vector/processor_spec.rb
geo_concerns-0.0.9 spec/processors/geo_concerns/processors/vector/processor_spec.rb
geo_concerns-0.0.8 spec/processors/geo_concerns/processors/vector/processor_spec.rb
geo_concerns-0.0.7 spec/processors/geo_concerns/processors/vector/processor_spec.rb
geo_concerns-0.0.6 spec/processors/geo_concerns/processors/vector/processor_spec.rb
geo_concerns-0.0.5 spec/processors/geo_concerns/processors/vector/processor_spec.rb
geo_concerns-0.0.4 spec/processors/geo_concerns/processors/vector/processor_spec.rb
geo_concerns-0.0.3 spec/processors/geo_concerns/processors/vector/processor_spec.rb
geo_concerns-0.0.2 spec/processors/geo_concerns/processors/vector/processor_spec.rb
geo_concerns-0.0.1 spec/processors/geo_concerns/processors/vector/processor_spec.rb