Sha256: 973ca583180f45ae4854073710bd3d5383ffce6666621f1cbab0dfed5cff7f74

Contents?: true

Size: 819 Bytes

Versions: 4

Compression:

Stored size: 819 Bytes

Contents

require 'test_helper'

module Vedeu

  describe Geometries do

    let(:described) { Vedeu::Geometries }

    describe '.geometries' do
      subject { described.geometries }

      it { subject.must_be_instance_of(described) }
    end

    describe '#by_name' do
      let(:_name) { 'carbon' }

      subject { described.geometries.by_name(_name) }

      context 'when the geometry exists' do
        before do
          Vedeu.geometry 'carbon' do
            x  1
            xn 3
            y  1
            yn 3
          end
        end

        it { subject.must_be_instance_of(Vedeu::Geometry) }
      end

      context 'when the geometry does not exist' do
        let(:_name) { 'nitrogen' }

        it { subject.must_be_instance_of(Vedeu::NullGeometry) }
      end
    end

  end # Geometries

end # Vedeu

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
vedeu-0.4.17 test/lib/vedeu/repositories/repositories/geometries_test.rb
vedeu-0.4.16 test/lib/vedeu/repositories/repositories/geometries_test.rb
vedeu-0.4.15 test/lib/vedeu/repositories/repositories/geometries_test.rb
vedeu-0.4.14 test/lib/vedeu/repositories/repositories/geometries_test.rb