Sha256: 0bcb2b149b77d7c8785206b808f72a4305af59f73853e2da4c2c6fc87f442393

Contents?: true

Size: 1.78 KB

Versions: 31

Compression:

Stored size: 1.78 KB

Contents

# frozen_string_literal: true

require 'test_helper'

module Vedeu

  module Cells

    describe Corner do

      let(:described)  { Vedeu::Cells::Corner }

      describe '#position' do
        let(:geometry) {
          Vedeu::Geometries::Geometry.new(x: 5, xn: 15, y: 3, yn: 9)
        }

        before { instance.stubs(:geometry).returns(geometry) }

        subject { instance.position }

        context 'when providing the position for the bottom left corner' do
          let(:instance) { Vedeu::Cells::BottomLeft.new }

          it { subject.must_be_instance_of(Vedeu::Geometries::Position) }
          it { subject.x.must_equal(5) }
          it { subject.y.must_equal(9) }
        end

        context 'when providing the position for the bottom right corner' do
          let(:instance) { Vedeu::Cells::BottomRight.new }

          it { subject.must_be_instance_of(Vedeu::Geometries::Position) }
          it { subject.x.must_equal(15) }
          it { subject.y.must_equal(9) }
        end

        context 'when providing the position for the top left corner' do
          let(:instance) { Vedeu::Cells::TopLeft.new }

          it { subject.must_be_instance_of(Vedeu::Geometries::Position) }
          it { subject.x.must_equal(5) }
          it { subject.y.must_equal(3) }
        end

        context 'when providing the position for the top right corner' do
          let(:instance) { Vedeu::Cells::TopRight.new }

          it { subject.must_be_instance_of(Vedeu::Geometries::Position) }
          it { subject.x.must_equal(15) }
          it { subject.y.must_equal(3) }
        end
      end

      describe '#text' do
        let(:instance) { Vedeu::Cells::TopRight.new }

        subject { instance.text }

        it { subject.must_equal('+') }
      end

    end # Corner

  end # Cells

end # Vedeu

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
vedeu-0.8.32 test/lib/vedeu/cells/borders/corner_test.rb
vedeu-0.8.31 test/lib/vedeu/cells/borders/corner_test.rb
vedeu-0.8.30 test/lib/vedeu/cells/borders/corner_test.rb
vedeu-0.8.29 test/lib/vedeu/cells/borders/corner_test.rb
vedeu-0.8.28 test/lib/vedeu/cells/borders/corner_test.rb
vedeu-0.8.27 test/lib/vedeu/cells/borders/corner_test.rb
vedeu-0.8.26 test/lib/vedeu/cells/borders/corner_test.rb
vedeu-0.8.25 test/lib/vedeu/cells/borders/corner_test.rb
vedeu-0.8.24 test/lib/vedeu/cells/borders/corner_test.rb
vedeu-0.8.23 test/lib/vedeu/cells/borders/corner_test.rb
vedeu-0.8.22 test/lib/vedeu/cells/borders/corner_test.rb
vedeu-0.8.21 test/lib/vedeu/cells/borders/corner_test.rb
vedeu-0.8.20 test/lib/vedeu/cells/borders/corner_test.rb
vedeu-0.8.19 test/lib/vedeu/cells/borders/corner_test.rb
vedeu-0.8.18 test/lib/vedeu/cells/borders/corner_test.rb
vedeu-0.8.17 test/lib/vedeu/cells/borders/corner_test.rb
vedeu-0.8.16 test/lib/vedeu/cells/borders/corner_test.rb
vedeu-0.8.15 test/lib/vedeu/cells/borders/corner_test.rb
vedeu-0.8.14 test/lib/vedeu/cells/borders/corner_test.rb
vedeu-0.8.13 test/lib/vedeu/cells/borders/corner_test.rb