Sha256: f92a7b155ccdbf7800c3a0b6c6332c65b946646852f2f7169a93742dbaaccde4

Contents?: true

Size: 1.87 KB

Versions: 15

Compression:

Stored size: 1.87 KB

Contents

require 'test_helper'

module Vedeu

  module Geometry

    class ValidatorTestClass
      include Vedeu::Geometry::Validator
    end

    describe Validator do

      let(:included) { Vedeu::Geometry::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 # Geometry

end # Vedeu

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
vedeu-0.6.60 test/lib/vedeu/geometry/validator_test.rb
vedeu-0.6.59 test/lib/vedeu/geometry/validator_test.rb
vedeu-0.6.58 test/lib/vedeu/geometry/validator_test.rb
vedeu-0.6.57 test/lib/vedeu/geometry/validator_test.rb
vedeu-0.6.56 test/lib/vedeu/geometry/validator_test.rb
vedeu-0.6.54 test/lib/vedeu/geometry/validator_test.rb
vedeu-0.6.53 test/lib/vedeu/geometry/validator_test.rb
vedeu-0.6.52 test/lib/vedeu/geometry/validator_test.rb
vedeu-0.6.51 test/lib/vedeu/geometry/validator_test.rb
vedeu-0.6.50 test/lib/vedeu/geometry/validator_test.rb
vedeu-0.6.49 test/lib/vedeu/geometry/validator_test.rb
vedeu-0.6.48 test/lib/vedeu/geometry/validator_test.rb
vedeu-0.6.47 test/lib/vedeu/geometry/validator_test.rb
vedeu-0.6.46 test/lib/vedeu/geometry/validator_test.rb
vedeu-0.6.45 test/lib/vedeu/geometry/validator_test.rb