Sha256: dbcc78ee433bfe9236e5d1248d3f94076172ff3059ff7636219a8967f6ab54c6

Contents?: true

Size: 1.01 KB

Versions: 9

Compression:

Stored size: 1.01 KB

Contents

# frozen_string_literal: true

require 'spec_helper'
require 'ogr/spatial_reference'

RSpec.describe OGR::SpatialReference do
  describe '#import_from_epsg' do
    context 'valid code' do
      it "updates self's info" do
        expect do
          subject.import_from_epsg(4326)
        end.to change { subject.to_wkt.size }.from(0)
      end

      it 'does not treat as lat/lon' do
        subject.import_from_epsg(4326)
        expect(subject.epsg_treats_as_lat_long?).to eq false
      end
    end

    context 'invalid code' do
      it 'raises a GDAL::UnsupportedOperation' do
        expect { subject.import_from_epsg 1_231_234 }.to raise_exception GDAL::UnsupportedOperation
      end
    end
  end

  describe '#import_from_epsga' do
    it "updates self's info" do
      expect do
        subject.import_from_epsga(4326)
      end.to change { subject.to_wkt.size }.from(0)
    end

    it 'treats as lat/lon' do
      subject.import_from_epsga(4326)
      expect(subject.epsg_treats_as_lat_long?).to eq true
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
ffi-gdal-1.0.0.beta16 spec/unit/ogr/spatial_reference_mixins/importers_spec.rb
ffi-gdal-1.0.0.beta15 spec/unit/ogr/spatial_reference_mixins/importers_spec.rb
ffi-gdal-1.0.0.beta14 spec/unit/ogr/spatial_reference_mixins/importers_spec.rb
ffi-gdal-1.0.0.beta13 spec/unit/ogr/spatial_reference_mixins/importers_spec.rb
ffi-gdal-1.0.0.beta12 spec/unit/ogr/spatial_reference_mixins/importers_spec.rb
ffi-gdal-1.0.0.beta11 spec/unit/ogr/spatial_reference_mixins/importers_spec.rb
ffi-gdal-1.0.0.beta10 spec/unit/ogr/spatial_reference_mixins/importers_spec.rb
ffi-gdal-1.0.0.beta9 spec/unit/ogr/spatial_reference_mixins/importers_spec.rb
ffi-gdal-1.0.0.beta8 spec/unit/ogr/spatial_reference_mixins/importers_spec.rb