Sha256: f290feb720d5692c5e9c76dc0e172679d009e4e242c67936aae632dc470a150b

Contents?: true

Size: 965 Bytes

Versions: 1

Compression:

Stored size: 965 Bytes

Contents

require_relative '../../../test_helper'
require_relative '../../../../lib/vedeu/models/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

1 entries across 1 versions & 1 rubygems

Version Path
vedeu-0.0.33 test/lib/vedeu/models/interface_collection_test.rb