Sha256: 7f36122ab858f6ede5e5e2f61e5332deb9e9cda1dd176479a4cc61e2fddf1bc5

Contents?: true

Size: 1.73 KB

Versions: 7

Compression:

Stored size: 1.73 KB

Contents

require File.dirname(__FILE__) + '/../spec_helper'

describe "Fog::Vcloud::Vdc", :type => :vcloud_model do

  describe :class do
    subject { Fog::Vcloud::Vdc }

    it { should have_identity :href }

    it { should have_only_these_attributes [:allocation_model, :cpu_capacity, :description, :enabled, :href, :memory_capacity, :name, :network_links, :network_quota,
                                            :nic_quota, :other_links, :resource_entity_links, :storage_capacity, :vcloud_type, :vm_quota, :xmlns] }
  end

  context "with no uri" do

    subject { Fog::Vcloud::Vdc.new() }

    its(:href) { should be_nil }
    its(:identity) { should be_nil }
  end

  context "as a collection member" do
    subject { @vcloud.vdcs[0] }

    its(:href)                  { should == URI.parse(@mock_vdc[:href]) }
    its(:identity)              { should == URI.parse(@mock_vdc[:href]) }
    its(:name)                  { should == @mock_vdc[:name] }
    its(:other_links)           { should have(7).items }
    its(:resource_entity_links) { should have(3).items }
    its(:network_links)         { should have(2).items }

    its(:cpu_capacity)          { should == Struct::VcloudXCapacity.new('Mhz',@mock_vdc[:cpu][:allocated], nil, @mock_vdc[:cpu][:allocated]) }
    its(:memory_capacity)       { should == Struct::VcloudXCapacity.new('MB',@mock_vdc[:memory][:allocated], nil, @mock_vdc[:memory][:allocated]) }
    its(:storage_capacity)      { should == Struct::VcloudXCapacity.new('MB',@mock_vdc[:storage][:allocated], nil, @mock_vdc[:storage][:allocated]) }

    its(:vm_quota)              { should == 0 }
    its(:nic_quota)             { should == 0 }
    its(:network_quota)         { should == 0 }

    its(:enabled)               { should == true }

  end



end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
fog-0.2.0 spec/vcloud/models/vdc_spec.rb
fog-0.1.10 spec/vcloud/models/vdc_spec.rb
fog-0.1.9 spec/vcloud/models/vdc_spec.rb
fog-0.1.8 spec/vcloud/models/vdc_spec.rb
fog-0.1.7 spec/vcloud/models/vdc_spec.rb
fog-0.1.6 spec/vcloud/models/vdc_spec.rb
fog-0.1.5 spec/vcloud/models/vdc_spec.rb