Sha256: 8ca6d877678563217dea30baa0c5498c1bae9a8a7661e5fb271e37d86f434d4f

Contents?: true

Size: 1.7 KB

Versions: 12

Compression:

Stored size: 1.7 KB

Contents

require 'minitest_helper'

describe Fog::Compute::XenServer::Models::Vlan do
  let(:vlan_class) do
    class Fog::Compute::XenServer::Models::Vlan
      def self.read_identity
        instance_variable_get('@identity')
      end
    end
    Fog::Compute::XenServer::Models::Vlan
  end

  it 'should associate to a provider class' do
    vlan_class.provider_class.must_equal('VLAN')
  end

  it 'should have a collection name' do
    vlan_class.collection_name.must_equal(:vlans)
  end

  it 'should have an unique id' do
    vlan_class.read_identity.must_equal(:reference)
  end

  it 'should have 4 attributes' do
    vlan_class.attributes.must_equal([ :reference,
                                       :other_config,
                                       :tag,
                                       :uuid ])
  end

  it 'should have 2 associations' do
    vlan_class.associations.must_equal(:tagged_pif => :pifs,
                                       :untagged_pif => :pifs)
  end

  it 'should have 6 masks' do
    vlan_class.masks.must_equal(:reference => :reference, 
                                :other_config => :other_config, 
                                :tag => :tag, 
                                :uuid => :uuid, 
                                :tagged_pif => :tagged_PIF, 
                                :untagged_pif => :untagged_PIF)
  end

  it 'should have 2 aliases' do
    vlan_class.aliases.must_equal(:tagged_PIF => :tagged_pif,
                                  :untagged_PIF => :untagged_pif)
  end

  it "shouldn't have default values" do
    vlan_class.default_values.must_equal({})
  end

  it 'should require 1 attribute before save' do
    vlan_class.require_before_save.must_equal([ :tag ])
  end
end

Version data entries

12 entries across 10 versions & 2 rubygems

Version Path
vagrant-packet-0.1.1 vendor/bundle/ruby/2.5.0/gems/fog-xenserver-0.3.0/spec/fog/compute/xen_server/models/vlan_spec.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.4.0/gems/fog-xenserver-0.3.0/spec/fog/compute/xen_server/models/vlan_spec.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.3.0/gems/fog-xenserver-0.3.0/spec/fog/compute/xen_server/models/vlan_spec.rb
fog-xenserver-0.3.0 spec/fog/compute/xen_server/models/vlan_spec.rb
fog-xenserver-0.2.3 spec/fog/compute/xen_server/models/vlan_spec.rb
fog-xenserver-0.2.2 spec/fog/compute/xen_server/models/vlan_spec.rb
fog-xenserver-0.2.1 spec/fog/compute/xen_server/models/vlan_spec.rb
fog-xenserver-0.2.0 spec/fog/compute/xen_server/models/vlan_spec.rb
fog-xenserver-0.1.2 spec/fog/compute/xen_server/models/vlan_spec.rb
fog-xenserver-0.1.1 spec/fog/compute/xen_server/models/vlan_spec.rb
fog-xenserver-0.1.0 spec/fog/compute/xen_server/models/vlan_spec.rb
fog-xenserver-0.0.1.beta2 spec/fog/compute/xen_server/models/vlan_spec.rb