Sha256: fb97bfd0dd3f8352155512ce3c6623d8d96dbc15b2e4b1ae0cc8b6327e20ffc9

Contents?: true

Size: 1 KB

Versions: 9

Compression:

Stored size: 1 KB

Contents

# frozen_string_literal: true

# Requirements:
#   * :child_geometry - one that the described class can
RSpec.shared_examples 'a container geometry' do
  describe '#collection?' do
    it 'returns true' do
      expect(subject.collection?).to eq true
    end
  end

  describe '#add_geometry' do
    it 'adds the geometry to the container' do
      skip
    end
  end

  describe '#add_directly' do
    it 'adds the geometry to the container' do
      skip
    end
  end

  describe '#remove_geometry' do
    it 'removes the geometry to the container' do
      skip
    end
  end

  describe '#geometry_at' do
    context 'geometry exists at the index' do
      subject do
        gc = described_class.new
        gc.add_geometry(child_geometry)
        gc
      end

      it 'returns the geometry' do
        expect(subject.geometry_at(0)).to be_a(child_geometry.class)
      end
    end

    context 'no geometries' do
      it 'returns nil' do
        expect(subject.geometry_at(0)).to be_nil
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
ffi-gdal-1.0.0.beta16 spec/support/shared_examples/ogr/a_container_geometry.rb
ffi-gdal-1.0.0.beta15 spec/support/shared_examples/ogr/a_container_geometry.rb
ffi-gdal-1.0.0.beta14 spec/support/shared_examples/ogr/a_container_geometry.rb
ffi-gdal-1.0.0.beta13 spec/support/shared_examples/ogr/a_container_geometry.rb
ffi-gdal-1.0.0.beta12 spec/support/shared_examples/ogr/a_container_geometry.rb
ffi-gdal-1.0.0.beta11 spec/support/shared_examples/ogr/a_container_geometry.rb
ffi-gdal-1.0.0.beta10 spec/support/shared_examples/ogr/a_container_geometry.rb
ffi-gdal-1.0.0.beta9 spec/support/shared_examples/ogr/a_container_geometry.rb
ffi-gdal-1.0.0.beta8 spec/support/shared_examples/ogr/a_container_geometry.rb