Sha256: d04ce7b001c6edfd1506a7488b4621f8fcc126b79db1dd32174801e5d9424b51

Contents?: true

Size: 1.19 KB

Versions: 1

Compression:

Stored size: 1.19 KB

Contents

require 'test_helper'

module Vedeu

  describe Composition do

    let(:described)  { Vedeu::Composition }
    let(:instance)   { described.new(attributes) }
    let(:attributes) {
      {
        interfaces: interfaces,
        colour:     colour,
        style:      style,
      }
    }
    let(:interfaces) { [] }
    let(:colour)     {}
    let(:style)      {}

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

      it { subject.must_be_instance_of(described) }
    end

    describe '#initialize' do
      subject { instance }

      it { subject.must_be_instance_of(described) }
      it { subject.instance_variable_get('@interfaces').must_equal(interfaces) }
    end

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

      subject { instance.add(child) }

      it { subject.must_be_instance_of(Vedeu::InterfaceCollection) }
    end

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

      it { subject.must_be_instance_of(Vedeu::InterfaceCollection) }
    end

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

      it { subject.must_be_instance_of(NilClass) }
    end

  end # Composition

end # Vedeu

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
vedeu-0.4.41 test/lib/vedeu/models/composition_test.rb