Sha256: 6fedf5072d102c528c496ff08d17ec5c0c4408bb540d1966d9119ac184ea8d26

Contents?: true

Size: 1.87 KB

Versions: 8

Compression:

Stored size: 1.87 KB

Contents

require 'test_helper'

module Vedeu

  module Borders

    describe Title do

      let(:described) { Vedeu::Borders::Title }
      let(:instance)  { described.new(_value, width, chars) }
      let(:_value)    { 'Aluminium' }
      let(:width)     { 10 }
      let(:chars)     { [] }

      describe '#initialize' do
        it { instance.must_be_instance_of(described) }
        it { instance.instance_variable_get('@value').must_equal(_value) }
        it { instance.instance_variable_get('@width').must_equal(width) }
        it { instance.instance_variable_get('@chars').must_equal(chars) }
      end

      describe '.render' do
        subject { described.render(_value, width, chars) }

        # @todo Add more tests.
      end

      describe '#eql?' do
        let(:other) { instance }

        subject { instance.eql?(other) }

        it { subject.must_equal(true) }

        context 'when different to other' do
          let(:other) { described.new('Vanadium') }

          it { subject.must_equal(false) }
        end
      end

      describe '#render' do
        let(:top_border) {}

        subject { instance.render(top_border) }

        context 'when the title is empty' do
          # @todo Add more tests.
        end

        context 'when the title is not empty' do
          # @todo Add more tests.
        end
      end

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

        it { subject.must_equal('Aluminium') }
      end

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

        it { instance.must_respond_to(:title) }
        it { instance.must_respond_to(:caption) }

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

          it { subject.must_equal('') }
        end

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

    end # Title

  end # Borders

end # Vedeu

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
vedeu-0.6.70 test/lib/vedeu/borders/title_test.rb
vedeu-0.6.69 test/lib/vedeu/borders/title_test.rb
vedeu-0.6.68 test/lib/vedeu/borders/title_test.rb
vedeu-0.6.67 test/lib/vedeu/borders/title_test.rb
vedeu-0.6.66 test/lib/vedeu/borders/title_test.rb
vedeu-0.6.65 test/lib/vedeu/borders/title_test.rb
vedeu-0.6.64 test/lib/vedeu/borders/title_test.rb
vedeu-0.6.63 test/lib/vedeu/borders/title_test.rb