Sha256: 01a047df8df1582893d59307fd2929f61b4dd255f482c023c2081bfd830ce796

Contents?: true

Size: 1.91 KB

Versions: 4

Compression:

Stored size: 1.91 KB

Contents

# frozen_string_literal: true

require 'test_helper'

module Vedeu

  module Geometries

    class ValidatorTestClass
      include Vedeu::Geometries::Validator
    end

    describe Validator do

      let(:included) { Vedeu::Geometries::ValidatorTestClass.new }

      describe '#validate_height!' do
        let(:_value) {}

        subject { included.validate_height!(_value) }

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

          it { subject.must_equal(true) }
        end

        context 'when the value is not given' do
          it { proc { subject }.must_raise(Vedeu::Error::InvalidSyntax) }
        end
      end

      describe '#validate_horizontal_alignment!' do
        let(:_value) {}

        subject { included.validate_horizontal_alignment!(_value) }

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

          it { subject.must_equal(true) }
        end

        context 'when the value is not given' do
          it { proc { subject }.must_raise(Vedeu::Error::InvalidSyntax) }
        end
      end

      describe '#validate_vertical_alignment!' do
        let(:_value) {}

        subject { included.validate_vertical_alignment!(_value) }

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

          it { subject.must_equal(true) }
        end

        context 'when the value is not given' do
          it { proc { subject }.must_raise(Vedeu::Error::InvalidSyntax) }
        end
      end

      describe '#validate_width!' do
        let(:_value) {}

        subject { included.validate_width!(_value) }

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

          it { subject.must_equal(true) }
        end

        context 'when the value is not given' do
          it { proc { subject }.must_raise(Vedeu::Error::InvalidSyntax) }
        end
      end

    end # Validator

  end # Geometries

end # Vedeu

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
vedeu-0.8.4 test/lib/vedeu/geometries/dsl/validator_test.rb
vedeu-0.8.3 test/lib/vedeu/geometries/dsl/validator_test.rb
vedeu-0.8.2 test/lib/vedeu/geometries/dsl/validator_test.rb
vedeu-0.8.1 test/lib/vedeu/geometries/dsl/validator_test.rb