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/ip_spec.rb

34 lines
929 B
Ruby
Raw Normal View History

require 'ecloud/spec_helper'
2010-06-09 19:20:14 -04:00
if Fog.mocking?
describe "Fog::Ecloud::Compute::Ip", :type => :mock_tmrk_ecloud_model do
subject { @vcloud }
2010-06-09 19:20:14 -04:00
describe :class do
subject { Fog::Ecloud::Compute::Ip }
2010-06-09 19:20:14 -04:00
it { should have_identity(:href) }
it { should have_only_these_attributes([:href, :name, :status, :server, :rnat, :id]) }
end
2010-06-09 19:20:14 -04:00
context "with no uri" do
subject { Fog::Ecloud::Compute::Ip.new() }
2010-06-09 19:20:14 -04:00
it { should have_all_attributes_be_nil }
end
2010-06-09 19:20:14 -04:00
context "as a collection member" do
subject { @ip = @vcloud.vdcs[0].networks[0].ips[0] }
2010-06-09 19:20:14 -04:00
it { should be_an_instance_of(Fog::Ecloud::Compute::Ip) }
2010-06-09 19:20:14 -04:00
its(:name) { should == @mock_data.network_ip_from_href(@ip.href).name }
its(:status) { should == @mock_data.network_ip_from_href(@ip.href).status }
its(:server) { should == @mock_data.network_ip_from_href(@ip.href).used_by.name }
2010-06-09 19:20:14 -04:00
end
2010-06-09 19:20:14 -04:00
end
else
2010-06-09 19:20:14 -04:00
end