Sha256: 18f434eb0ed4b4220d6c4730bf5b38b322dcefd4c14b21a42ca391e509dbb927

Contents?: true

Size: 994 Bytes

Versions: 4

Compression:

Stored size: 994 Bytes

Contents

# 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

4 entries across 4 versions & 1 rubygems

Version Path
ffi-gdal-1.0.0.beta7 spec/support/shared_examples/ogr/a_container_geometry.rb
ffi-gdal-1.0.0.beta6 spec/support/shared_examples/ogr/a_container_geometry.rb
ffi-gdal-1.0.0.beta5 spec/support/shared_examples/ogr/a_container_geometry.rb
ffi-gdal-1.0.0.beta4 spec/support/shared_examples/ogr/a_container_geometry.rb