Sha256: 694c7ddb490444a49107dd66aab9eb1de79b4fb717bccb7b8c78cdf85452acbc

Contents?: true

Size: 1.65 KB

Versions: 6

Compression:

Stored size: 1.65 KB

Contents

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

6 entries across 6 versions & 1 rubygems

Version Path
vedeu-0.8.0 test/lib/vedeu/presentation/background_test.rb
vedeu-0.7.4 test/lib/vedeu/presentation/background_test.rb
vedeu-0.7.3 test/lib/vedeu/presentation/background_test.rb
vedeu-0.7.2 test/lib/vedeu/presentation/background_test.rb
vedeu-0.7.1 test/lib/vedeu/presentation/background_test.rb
vedeu-0.7.0 test/lib/vedeu/presentation/background_test.rb