Sha256: afd8b300300fec74dc342d1443740eda6a171bfb5c5f38e8bd4704e867bd9e9b

Contents?: true

Size: 1.68 KB

Versions: 23

Compression:

Stored size: 1.68 KB

Contents

require 'test_helper'

module Vedeu

  module Geometry

    describe XDimension do

      let(:described)  { Vedeu::Geometry::XDimension }
      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.width }
      let(:maximised)            {}
      let(:horizontal_alignment) {}
      let(:vertical_alignment)   {}

      before do
        Vedeu.stubs(:width).returns(24)
      end

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

        it { subject.must_be_instance_of(Array) }

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

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

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

        context 'when centre aligned' do
          let(:horizontal_alignment) { :centre }

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

        context 'when left aligned' do
          let(:horizontal_alignment) { :left }

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

        context 'when right aligned' do
          let(:horizontal_alignment) { :right }

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

    end # XDimension

  end # Geometry

end # Vedeu

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
vedeu-0.6.60 test/lib/vedeu/geometry/x_dimension_test.rb
vedeu-0.6.59 test/lib/vedeu/geometry/x_dimension_test.rb
vedeu-0.6.58 test/lib/vedeu/geometry/x_dimension_test.rb
vedeu-0.6.57 test/lib/vedeu/geometry/x_dimension_test.rb
vedeu-0.6.56 test/lib/vedeu/geometry/x_dimension_test.rb
vedeu-0.6.54 test/lib/vedeu/geometry/x_dimension_test.rb
vedeu-0.6.53 test/lib/vedeu/geometry/x_dimension_test.rb
vedeu-0.6.52 test/lib/vedeu/geometry/x_dimension_test.rb
vedeu-0.6.51 test/lib/vedeu/geometry/x_dimension_test.rb
vedeu-0.6.50 test/lib/vedeu/geometry/x_dimension_test.rb
vedeu-0.6.49 test/lib/vedeu/geometry/x_dimension_test.rb
vedeu-0.6.48 test/lib/vedeu/geometry/x_dimension_test.rb
vedeu-0.6.47 test/lib/vedeu/geometry/x_dimension_test.rb
vedeu-0.6.46 test/lib/vedeu/geometry/x_dimension_test.rb
vedeu-0.6.45 test/lib/vedeu/geometry/x_dimension_test.rb
vedeu-0.6.44 test/lib/vedeu/geometry/x_dimension_test.rb
vedeu-0.6.43 test/lib/vedeu/geometry/x_dimension_test.rb
vedeu-0.6.42 test/lib/vedeu/geometry/x_dimension_test.rb
vedeu-0.6.41 test/lib/vedeu/geometry/x_dimension_test.rb
vedeu-0.6.40 test/lib/vedeu/geometry/x_dimension_test.rb