Sha256: 052f77adfd175e2bb5c44843578b599f563bd2141ba6ce54810dcc22da83945a

Contents?: true

Size: 1.15 KB

Versions: 9

Compression:

Stored size: 1.15 KB

Contents

# frozen_string_literal: true

require 'spec_helper'
require 'ogr/spatial_reference'

RSpec.describe OGR::SpatialReference do
  describe '.projection_methods' do
    context 'strip underscores' do
      subject { described_class.projection_methods(true) }

      it 'returns an Array of Strings' do
        expect(subject).to be_an Array
        expect(subject.first).to be_a String
      end

      it 'has Strings with no underscores' do
        expect(subject).to(satisfy { |v| !v.include?('_') })
      end
    end

    context 'not strip underscores' do
      subject { described_class.projection_methods(false) }

      it 'returns an Array of Strings' do
        expect(subject).to be_an Array
        expect(subject.first).to be_a String
      end

      it 'has Strings with underscores' do
        expect(subject).to(satisfy { |v| !v.include?(' ') })
      end
    end
  end

  describe '#copy_geog_cs_from' do
    let(:other_srs) { OGR::SpatialReference.new_from_epsg(4326) }

    it 'copies the info over' do
      expect(subject.to_wkt).to be_empty
      subject.copy_geog_cs_from(other_srs)
      expect(subject.to_wkt).to eq other_srs.to_wkt
    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_spec.rb
ffi-gdal-1.0.0.beta15 spec/unit/ogr/spatial_reference_spec.rb
ffi-gdal-1.0.0.beta14 spec/unit/ogr/spatial_reference_spec.rb
ffi-gdal-1.0.0.beta13 spec/unit/ogr/spatial_reference_spec.rb
ffi-gdal-1.0.0.beta12 spec/unit/ogr/spatial_reference_spec.rb
ffi-gdal-1.0.0.beta11 spec/unit/ogr/spatial_reference_spec.rb
ffi-gdal-1.0.0.beta10 spec/unit/ogr/spatial_reference_spec.rb
ffi-gdal-1.0.0.beta9 spec/unit/ogr/spatial_reference_spec.rb
ffi-gdal-1.0.0.beta8 spec/unit/ogr/spatial_reference_spec.rb