Sha256: 867a72746b01646c7201ea858eca9ff44f1b88161927e279c7c03d8c0785b3fb

Contents?: true

Size: 985 Bytes

Versions: 6

Compression:

Stored size: 985 Bytes

Contents

require_relative '../../../../test_helper'
require_relative '../../../../../lib/vedeu/models/attributes/interface_collection'
require_relative '../../../../../lib/vedeu/models/composition'

module Vedeu
  describe InterfaceCollection do
    describe '#coerce' do
      before { InterfaceRepository.reset }

      it 'returns an empty collection when there are no interfaces' do
        composition = Composition.new
        composition.interfaces.must_equal([])
      end

      it 'returns a collection when there is a single interface' do
        composition = Composition.new({ interfaces: { name: 'InterfaceCollection#coerce' } })
        composition.interfaces.first.must_be_instance_of(Interface)
      end

      it 'returns a collection when there are multiple interfaces' do
        composition = Composition.new({ interfaces: [
          { name: 'dumb' },
          { name: 'dumber' }
        ]})
        composition.interfaces.size.must_equal(2)
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
vedeu-0.0.39 test/lib/vedeu/models/attributes/interface_collection_test.rb
vedeu-0.0.38 test/lib/vedeu/models/attributes/interface_collection_test.rb
vedeu-0.0.37 test/lib/vedeu/models/attributes/interface_collection_test.rb
vedeu-0.0.36 test/lib/vedeu/models/attributes/interface_collection_test.rb
vedeu-0.0.35 test/lib/vedeu/models/attributes/interface_collection_test.rb
vedeu-0.0.34 test/lib/vedeu/models/attributes/interface_collection_test.rb