Sha256: a5994e0974a8af6e46db19bbf9e0f2aab3b9b9ac3d5af9f35f35351f0389e8a2

Contents?: true

Size: 1.14 KB

Versions: 4

Compression:

Stored size: 1.14 KB

Contents

require 'spec_helper'
require 'ogr/layer'

RSpec.describe OGR::Layer do
  include_context 'OGR::Layer, spatial_reference'

  describe '#spatial_filter' do
    context 'default' do
      subject { layer.spatial_filter }
      it { is_expected.to be_nil }
    end
  end

  describe '#spatial_filter= + #spatial_filter' do
    it 'assigns the spatial_filter to the new geometry' do
      geometry = OGR::Geometry.create_from_wkt('POINT (1 1)')
      subject.spatial_filter = geometry
      expect(subject.spatial_filter).to eq geometry
    end
  end

  describe '#set_spatial_filter_ex' do
    it 'does not die' do
      geometry = OGR::Geometry.create_from_wkt('POINT (1 1)')
      expect { subject.set_spatial_filter_ex(0, geometry) }.to_not raise_exception
    end
  end

  describe '#set_spatial_filter_rectangle' do
    it 'does not die' do
      expect { subject.set_spatial_filter_rectangle(0, 0, 1000, 1000) }.
        to_not raise_exception
    end
  end

  describe '#set_spatial_filter_rectangle_ex' do
    it 'does not die' do
      expect { subject.set_spatial_filter_rectangle_ex(0, 0, 0, 1000, 1000) }.
        to_not raise_exception
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
ffi-gdal-1.0.0.beta7 spec/unit/ogr/layer_mixins/ogr_query_filter_methods_spec.rb
ffi-gdal-1.0.0.beta6 spec/unit/ogr/layer_mixins/ogr_query_filter_methods_spec.rb
ffi-gdal-1.0.0.beta5 spec/unit/ogr/layer_mixins/ogr_query_filter_methods_spec.rb
ffi-gdal-1.0.0.beta4 spec/unit/ogr/layer_mixins/ogr_query_filter_methods_spec.rb