Sha256: a61e0653fc86880ed4c4a1231b81f18cc5c3e0dc22daae0346ac34fcf2ff179d

Contents?: true

Size: 1.64 KB

Versions: 28

Compression:

Stored size: 1.64 KB

Contents

require 'test_helper'

module Vedeu

  module Views

    describe Composition do

      let(:described)  { Vedeu::Views::Composition }
      let(:instance)   { described.new(attributes) }
      let(:attributes) {
        {
          client: client,
          colour: colour,
          parent: parent,
          style:  style,
          value:  _value,
        }
      }
      let(:client) {}
      let(:colour) {}
      let(:parent) {}
      let(:style)  {}
      let(:_value) {}

      describe '.build' do
        subject {
          described.build({}) do
            # ...
          end
        }

        it { subject.must_be_instance_of(described) }
      end

      describe '#initialize' do
        it { instance.must_be_instance_of(described) }
        it { instance.instance_variable_get('@client').must_equal(client) }
        it { instance.instance_variable_get('@colour').must_equal(colour) }
        it { instance.instance_variable_get('@parent').must_equal(parent) }
        it { instance.instance_variable_get('@style').must_equal(style) }
        it { instance.instance_variable_get('@value').must_equal(_value) }
      end

      describe 'accessors' do
        it { instance.must_respond_to(:attributes) }
        it { instance.must_respond_to(:parent) }
        it { instance.must_respond_to(:value) }
        it { instance.must_respond_to(:views) }
      end

      describe '#add' do
        let(:child) { Vedeu::Views::View.new }

        subject { instance.add(child) }

        it { instance.must_respond_to(:<<) }

        it { subject.must_be_instance_of(Vedeu::Views::ViewCollection) }
      end


    end # Composition

  end # Views

end # Vedeu

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
vedeu-0.6.19 test/lib/vedeu/models/views/composition_test.rb
vedeu-0.6.18 test/lib/vedeu/models/views/composition_test.rb
vedeu-0.6.17 test/lib/vedeu/models/views/composition_test.rb
vedeu-0.6.16 test/lib/vedeu/models/views/composition_test.rb
vedeu-0.6.15 test/lib/vedeu/models/views/composition_test.rb
vedeu-0.6.14 test/lib/vedeu/models/views/composition_test.rb
vedeu-0.6.13 test/lib/vedeu/models/views/composition_test.rb
vedeu-0.6.12 test/lib/vedeu/models/views/composition_test.rb
vedeu-0.6.11 test/lib/vedeu/models/views/composition_test.rb
vedeu-0.6.10 test/lib/vedeu/models/views/composition_test.rb
vedeu-0.6.9 test/lib/vedeu/models/views/composition_test.rb
vedeu-0.6.8 test/lib/vedeu/models/views/composition_test.rb
vedeu-0.6.7 test/lib/vedeu/models/views/composition_test.rb
vedeu-0.6.6 test/lib/vedeu/models/views/composition_test.rb
vedeu-0.6.5 test/lib/vedeu/models/views/composition_test.rb
vedeu-0.6.4 test/lib/vedeu/models/views/composition_test.rb
vedeu-0.6.3 test/lib/vedeu/models/views/composition_test.rb
vedeu-0.6.2 test/lib/vedeu/models/views/composition_test.rb
vedeu-0.6.1 test/lib/vedeu/models/views/composition_test.rb
vedeu-0.6.0 test/lib/vedeu/models/views/composition_test.rb