Sha256: 5e372ecad7c5ed2b111ead0104013f105203ba42aeac2215c2cb2c6fbb6dd0b3

Contents?: true

Size: 1.04 KB

Versions: 6

Compression:

Stored size: 1.04 KB

Contents

require 'spec_helper'
require 'open3'

describe GeoConcerns::Processors::Vector::Info do
  let(:path) { 'test.tif' }
  let(:info_doc) { read_test_data_fixture('ogrinfo.txt') }

  subject { described_class.new(path) }

  context 'when initializing a new info class' do
    it 'shells out to ogrinfo and sets the doc variable to the output string' do
      expect(Open3).to receive(:capture3).with("ogrinfo #{path}")
        .and_return([info_doc, '', ''])
      expect(subject.doc).to eq(info_doc)
    end
  end

  context 'after intialization' do
    before do
      allow(subject).to receive(:doc).and_return(info_doc)
    end

    describe '#name' do
      it 'returns with min and max values' do
        expect(subject.name).to eq('tufts-cambridgegrid100-04')
      end
    end

    describe '#driver' do
      it 'returns with min and max values' do
        expect(subject.driver).to eq('ESRI Shapefile')
      end
    end

    describe '#geom' do
      it 'returns raster size' do
        expect(subject.geom).to eq('Polygon')
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
geo_concerns-0.0.10 spec/processors/geo_concerns/processors/vector/info_spec.rb
geo_concerns-0.0.9 spec/processors/geo_concerns/processors/vector/info_spec.rb
geo_concerns-0.0.8 spec/processors/geo_concerns/processors/vector/info_spec.rb
geo_concerns-0.0.7 spec/processors/geo_concerns/processors/vector/info_spec.rb
geo_concerns-0.0.6 spec/processors/geo_concerns/processors/vector/info_spec.rb
geo_concerns-0.0.5 spec/processors/geo_concerns/processors/vector/info_spec.rb