Sha256: f0aa62521436c930a3c6d37059274e4f71afa54740f02056ace0779bf3aee662

Contents?: true

Size: 1.46 KB

Versions: 16

Compression:

Stored size: 1.46 KB

Contents

require 'test_helper'

module Vedeu

  module Geometries

    describe HorizontalAlignment do

      let(:described) { Vedeu::Geometries::HorizontalAlignment }
      let(:instance)  { described.new(_value) }
      let(:_value)    {}

      describe '.align' do
        subject { described.align(_value) }

        context 'when the value is :none' do
          let(:_value) { :none }

          it { subject.must_equal(:none) }
        end

        context 'when the value is nil' do
          it { subject.must_equal(:none) }
        end

        context 'when the value is not a Symbol' do
          let(:_value) { 'invalid' }

          it { subject.must_equal(:none) }
        end

        context 'when the value is :center' do
          let(:_value) { :center }

          it { subject.must_equal(:centre) }
        end

        context 'when the value is :centre' do
          let(:_value) { :centre }

          it { subject.must_equal(:centre) }
        end

        context 'when the value is :left' do
          let(:_value) { :left }

          it { subject.must_equal(:left) }
        end

        context 'when the value is :right' do
          let(:_value) { :right }

          it { subject.must_equal(:right) }
        end

        context 'when the value is :align_invalid' do
          let(:_value) { :align_invalid }

          it { proc { subject }.must_raise(Vedeu::Error::InvalidSyntax) }
        end
      end

    end # HorizontalAlignment

  end # Geometries

end # Vedeu

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
vedeu-0.7.4 test/lib/vedeu/geometries/alignment/horizontal_alignment_test.rb
vedeu-0.7.3 test/lib/vedeu/geometries/alignment/horizontal_alignment_test.rb
vedeu-0.7.2 test/lib/vedeu/geometries/alignment/horizontal_alignment_test.rb
vedeu-0.7.1 test/lib/vedeu/geometries/alignment/horizontal_alignment_test.rb
vedeu-0.7.0 test/lib/vedeu/geometries/alignment/horizontal_alignment_test.rb
vedeu-0.6.71 test/lib/vedeu/geometries/alignment/horizontal_alignment_test.rb
vedeu-0.6.70 test/lib/vedeu/geometries/alignment/horizontal_alignment_test.rb
vedeu-0.6.69 test/lib/vedeu/geometries/alignment/horizontal_alignment_test.rb
vedeu-0.6.68 test/lib/vedeu/geometries/horizontal_alignment_test.rb
vedeu-0.6.67 test/lib/vedeu/geometries/horizontal_alignment_test.rb
vedeu-0.6.66 test/lib/vedeu/geometries/horizontal_alignment_test.rb
vedeu-0.6.65 test/lib/vedeu/geometries/horizontal_alignment_test.rb
vedeu-0.6.64 test/lib/vedeu/geometries/horizontal_alignment_test.rb
vedeu-0.6.63 test/lib/vedeu/geometries/horizontal_alignment_test.rb
vedeu-0.6.62 test/lib/vedeu/geometries/horizontal_alignment_test.rb
vedeu-0.6.61 test/lib/vedeu/geometries/horizontal_alignment_test.rb