Sha256: 8cc67df51435d9c8dad4173add7296facfef559313d0bcb5bb738c124d4119e1

Contents?: true

Size: 1008 Bytes

Versions: 1

Compression:

Stored size: 1008 Bytes

Contents

require 'test_helper'

require 'json'

module Vedeu

  describe Composition do
    let(:described)  { Composition.new(attributes) }
    let(:attributes) { {} }

    before { Buffers.reset }

    describe '#initialize' do
      it { return_type_for(described, Composition) }
      it { assigns(described, '@attributes', { interfaces: [] }) }
    end

    describe '#interfaces' do
      it 'returns a collection of interfaces' do
        Vedeu.interface('dummy') do
          width  5
          height 5
        end
        Composition.new({
          interfaces: {
            name:  'dummy',
            lines: []
          }
        }).interfaces.first.must_be_instance_of(Interface)
      end

      it 'returns an empty collection when no interfaces are associated' do
        described.interfaces.must_be_empty
      end
    end

    describe '#method_missing' do
      it 'returns nil' do
        described.some_missing_method(:test).must_equal(nil)
      end
    end

  end # Composition

end # Vedeu

Version data entries

1 entries across 1 versions & 1 rubygems

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