Sha256: 6e465bef7e79c14dd554bcf5c31dddd4877f46bc248404d68558dd537bdc1e11

Contents?: true

Size: 1.68 KB

Versions: 4

Compression:

Stored size: 1.68 KB

Contents

# frozen_string_literal: true

require 'test_helper'

module Vedeu

  module Presentation

    module Colour

      describe Background 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 '#background' do
          subject { includer.background }

          it { subject.must_be_instance_of(Vedeu::Colours::Background) }

          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('#330000') }
            end
          end

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

          # @todo Add more tests.
        end

        describe '#background=' do
          subject { includer.background = '#987654' }

          it do
            includer.colour.background.colour.must_equal('#000033')
            subject
            includer.colour.background.colour.must_equal('#987654')
          end

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

      end # Background

    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/background_test.rb
vedeu-0.8.3 test/lib/vedeu/presentation/background_test.rb
vedeu-0.8.2 test/lib/vedeu/presentation/background_test.rb
vedeu-0.8.1 test/lib/vedeu/presentation/background_test.rb