Sha256: 2a12c7430c68d1c977a79206d5bb8e0062d9e262454a6c030c35052170cb7dbf

Contents?: true

Size: 1.68 KB

Versions: 23

Compression:

Stored size: 1.68 KB

Contents

require 'test_helper'

module Vedeu

  module Geometry

    describe YDimension do

      let(:described)  { Vedeu::Geometry::YDimension }
      let(:instance)   { described.new(attributes) }
      let(:attributes) {
        {
          d:                    d,
          dn:                   dn,
          d_dn:                 d_dn,
          default:              default,
          maximised:            maximised,
          horizontal_alignment: horizontal_alignment,
          vertical_alignment:   vertical_alignment,
        }
      }
      let(:d)                    {}
      let(:dn)                   {}
      let(:d_dn)                 {}
      let(:default)              { Vedeu.height }
      let(:maximised)            {}
      let(:horizontal_alignment) {}
      let(:vertical_alignment)   {}

      before do
        Vedeu.stubs(:height).returns(12)
      end

      describe '#pair' do
        subject { instance.pair }

        it { subject.must_be_instance_of(Array) }

        context 'with default attributes' do
          it { subject.must_equal([1, 12]) }
        end

        context 'when maximised' do
          let(:maximised) { true }

          it { subject.must_equal([1, 12]) }
        end

        context 'when bottom aligned' do
          let(:vertical_alignment) { :bottom }

          it { subject.must_equal([1, 12]) }
        end

        context 'when middle aligned' do
          let(:vertical_alignment) { :middle }

          it { subject.must_equal([1, 12]) }
        end

        context 'when top aligned' do
          let(:vertical_alignment) { :top }

          it { subject.must_equal([1, 12]) }
        end
      end

    end # YDimension

  end # Geometry

end # Vedeu

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
vedeu-0.6.39 test/lib/vedeu/geometry/y_dimension_test.rb
vedeu-0.6.38 test/lib/vedeu/geometry/y_dimension_test.rb
vedeu-0.6.37 test/lib/vedeu/geometry/y_dimension_test.rb