Sha256: 2ece78362f793fca66936367820391e668454f0329a455af856ba1cd92d890e0

Contents?: true

Size: 1.73 KB

Versions: 4

Compression:

Stored size: 1.73 KB

Contents

# frozen_string_literal: true

require 'test_helper'

module Vedeu

  module Presentation

    module Colour

      describe Foreground do

        let(:includer) { Vedeu::PresentationColourTestClass.new(attributes) }
        let(:attributes) {
          {
            colour: colour,
            parent: parent
          }
        }
        let(:colour)     {
          {
            background: background,
            foreground: foreground
          }
        }
        let(:background) { '#000033' }
        let(:foreground) { '#aadd00' }
        let(:parent)     { Vedeu::ParentPresentationColourTestClass.new }

        describe '#foreground' do
          subject { includer.foreground }

          it { subject.must_be_instance_of(Vedeu::Colours::Foreground) }
          it { subject.colour.must_equal('#aadd00') }

          context 'when a colour is not set' do
            let(:colour) {}

            context 'when a parent is not available' do
              let(:parent) {}

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

            context 'when a parent is available' do
              it { subject.colour.must_equal('#00aadd') }
            end
          end

          context 'when a colour is set' do
            it { subject.colour.must_equal('#aadd00') }
          end

          # @todo Add more tests.
        end

        describe '#foreground=' do
          subject { includer.foreground = '#123456' }

          it do
            includer.colour.foreground.colour.must_equal('#aadd00')
            subject
            includer.colour.foreground.colour.must_equal('#123456')
          end

          it { subject.must_equal('#123456') }
        end

      end # Foreground

    end # Colour

  end # Presentation

end # Vedeu

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
vedeu-0.8.4 test/lib/vedeu/presentation/foreground_test.rb
vedeu-0.8.3 test/lib/vedeu/presentation/foreground_test.rb
vedeu-0.8.2 test/lib/vedeu/presentation/foreground_test.rb
vedeu-0.8.1 test/lib/vedeu/presentation/foreground_test.rb