Sha256: 2e71f1be41f3e649723497686a49152ce75bb8774549c3cd6522265e2b103a3b

Contents?: true

Size: 900 Bytes

Versions: 6

Compression:

Stored size: 900 Bytes

Contents

require 'test_helper'
require 'vedeu/models/attributes/interface_collection'
require 'vedeu/models/composition'

module Vedeu
  describe InterfaceCollection do
    describe '#coerce' do
      before { Persistence.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.1.2 test/lib/vedeu/models/attributes/interface_collection_test.rb
vedeu-0.1.1 test/lib/vedeu/models/attributes/interface_collection_test.rb
vedeu-0.1.0 test/lib/vedeu/models/attributes/interface_collection_test.rb
vedeu-0.0.42 test/lib/vedeu/models/attributes/interface_collection_test.rb
vedeu-0.0.41 test/lib/vedeu/models/attributes/interface_collection_test.rb
vedeu-0.0.40 test/lib/vedeu/models/attributes/interface_collection_test.rb