1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00
fog--fog/spec/ecloud/models/public_ip_spec.rb

37 lines
1 KiB
Ruby
Raw Normal View History

require 'ecloud/spec_helper'
2010-05-27 17:17:59 -04:00
if Fog.mocking?
describe "Fog::Compute::Ecloud::PublicIp", :type => :mock_tmrk_ecloud_model do
subject { @vcloud }
2010-05-27 17:17:59 -04:00
describe :class do
subject { Fog::Compute::Ecloud::PublicIp }
2010-05-27 17:17:59 -04:00
it { should have_identity(:href) }
it { should have_only_these_attributes([:name, :id, :href]) }
end
2010-05-27 17:17:59 -04:00
context "with no uri" do
2010-05-27 17:17:59 -04:00
subject { Fog::Compute::Ecloud::PublicIp.new() }
2010-05-27 17:17:59 -04:00
it { should have_all_attributes_be_nil }
end
context "as a collection member" do
subject { @vcloud.vdcs[0].public_ips[0].reload; @vcloud.vdcs[0].public_ips[0] }
2010-05-27 17:17:59 -04:00
it { should be_an_instance_of(Fog::Compute::Ecloud::PublicIp) }
2010-05-27 17:17:59 -04:00
its(:href) { should == @mock_public_ip.href }
its(:identity) { should == @mock_public_ip.href }
its(:name) { should == @mock_public_ip.name }
its(:id) { should == @mock_public_ip.object_id.to_s }
2010-05-27 17:17:59 -04:00
its(:internet_services) { should have(2).services }
end
2010-05-27 17:17:59 -04:00
end
else
2010-05-27 17:17:59 -04:00
end