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

add some missing parens to fix warnings

This commit is contained in:
geemus 2011-02-15 13:47:14 -08:00
parent ca3e2b2432
commit cc69972678
50 changed files with 194 additions and 205 deletions

View file

@ -17,9 +17,9 @@ GEM
builder (3.0.0)
excon (0.5.2)
formatador (0.0.16)
json (1.4.6)
json (1.5.1)
mime-types (1.16)
net-ssh (2.0.23)
net-ssh (2.1.0)
nokogiri (1.4.4)
rake (0.8.7)
rspec (1.3.1)

View file

@ -33,7 +33,7 @@ module Fog
@credentials ||= begin
if File.exists?(credentials_path)
credentials = YAML.load_file(credentials_path)
(credentials && credentials[credential]) or raise LoadError.new missing_credentials
(credentials && credentials[credential]) or raise LoadError.new(missing_credentials)
else
{}
end

View file

@ -6,24 +6,24 @@ if Fog.mocking?
describe :class do
subject { Fog::Vcloud::Vdc }
it { should have_identity :href }
it { should have_identity(:href) }
it { should have_only_these_attributes [:href, :name, :type, :description, :other_links, :compute_capacity, :storage_capacity, :available_networks,
:resource_entities, :enabled, :vm_quota, :nic_quota, :network_quota, :allocation_model] }
it { should have_only_these_attributes([:href, :name, :type, :description, :other_links, :compute_capacity, :storage_capacity, :available_networks,
:resource_entities, :enabled, :vm_quota, :nic_quota, :network_quota, :allocation_model]) }
end
context "with no uri" do
subject { Fog::Vcloud::Vdc.new() }
it { should have_all_attributes_be_nil }
it { should(have_all_attributes_be_nil) }
end
context "as a collection member" do
subject { @vcloud.vdcs[0].reload }
it { should be_an_instance_of Fog::Vcloud::Vdc }
it { should be_an_instance_of(Fog::Vcloud::Vdc) }
its(:href) { should == @mock_vdc.href }
its(:identity) { should == @mock_vdc.href }
@ -32,12 +32,12 @@ if Fog.mocking?
its(:resource_entities) { should have(3).items }
its(:available_networks) { should have(2).items }
its(:compute_capacity) { should be_an_instance_of Hash }
its(:compute_capacity) { should be_an_instance_of(Hash) }
its(:compute_capacity) { should == {:Cpu =>
{:Units => "Mhz", :Allocated => @mock_vdc.cpu_allocated.to_s, :Limit => @mock_vdc.cpu_allocated.to_s},
:Memory =>
{:Units => "MB", :Allocated => @mock_vdc.memory_allocated.to_s, :Limit => @mock_vdc.memory_allocated.to_s}} }
its(:storage_capacity) { should be_an_instance_of Hash }
its(:storage_capacity) { should be_an_instance_of(Hash) }
its(:storage_capacity) { should == {:Limit => @mock_vdc.storage_allocated.to_s, :Units=>"MB", :Allocated => @mock_vdc.storage_allocated.to_s} }
its(:vm_quota) { should == "0" }
@ -48,5 +48,4 @@ if Fog.mocking?
end
end
else
end

View file

@ -4,7 +4,7 @@ if Fog.mocking?
describe Fog::Vcloud, :type => :mock_vcloud_request do
subject { @vcloud }
it { should respond_to :get_network }
it { should respond_to(:get_network) }
describe :get_network, :type => :vcloud_request do
context "with a valid network uri" do
@ -12,7 +12,7 @@ if Fog.mocking?
subject { @network }
it_should_behave_like "all responses"
it { should have_headers_denoting_a_content_type_of "application/vnd.vmware.vcloud.network+xml" }
it { should have_headers_denoting_a_content_type_of("application/vnd.vmware.vcloud.network+xml") }
describe :body do
subject { @network.body }
@ -20,19 +20,19 @@ if Fog.mocking?
it { should have(9).keys }
it_should_behave_like "it has the standard vcloud v0.8 xmlns attributes" # 3 keys
it { should have_key_with_value :type, "application/vnd.vmware.vcloud.network+xml" }
it { should have_key_with_value :Features, {:FenceMode => "isolated"} }
it { should have_key_with_value :Description, @mock_network.name }
it { should have_key_with_value :href, @mock_network.href }
it { should have_key_with_value :name, @mock_network.name }
it { should have_key_with_value :Configuration, {:Gateway => @mock_network.gateway,
it { should have_key_with_value(:type, "application/vnd.vmware.vcloud.network+xml") }
it { should have_key_with_value(:Features, {:FenceMode => "isolated"}) }
it { should have_key_with_value(:Description, @mock_network.name) }
it { should have_key_with_value(:href, @mock_network.href) }
it { should have_key_with_value(:name, @mock_network.name) }
it { should have_key_with_value(:Configuration, {:Gateway => @mock_network.gateway,
:Netmask => @mock_network.netmask,
:Dns => @mock_network.dns } }
:Dns => @mock_network.dns }) }
end
end
context "with a network uri that doesn't exist" do
subject { lambda { @vcloud.get_network(URI.parse('https://www.fakey.com/api/v0.8/network/999')) } }
it_should_behave_like "a request for a resource that doesn't exist"
it_should_behave_like("a request for a resource that doesn't exist")
end
end
end

View file

@ -4,7 +4,7 @@ if Fog.mocking?
describe Fog::Vcloud, :type => :mock_vcloud_request do
subject { @vcloud }
it { should respond_to :get_organization }
it { should respond_to(:get_organization) }
describe "#get_organization" do
context "with a valid organization uri" do
@ -12,7 +12,7 @@ if Fog.mocking?
subject { @organization }
it_should_behave_like "all responses"
it { should have_headers_denoting_a_content_type_of "application/vnd.vmware.vcloud.org+xml" }
it { should have_headers_denoting_a_content_type_of("application/vnd.vmware.vcloud.org+xml") }
describe "#body" do
subject { @organization.body }
@ -23,9 +23,9 @@ if Fog.mocking?
it { should have(6).keys }
it_should_behave_like "it has the standard vcloud v0.8 xmlns attributes" # 3 keys
it { should have_key_with_value :href, @mock_organization.href }
it { should have_key_with_value :name, @mock_organization.name }
it { should have_key_with_array :Link, @mock_organization.vdcs.map { |vdc|
it { should have_key_with_value(:href, @mock_organization.href)}
it { should have_key_with_value(:name, @mock_organization.name) }
it { should have_key_with_array(:Link, @mock_organization.vdcs.map { |vdc|
[{ :type => "application/vnd.vmware.vcloud.vdc+xml",
:href => vdc.href,
:name => vdc.name,
@ -38,16 +38,15 @@ if Fog.mocking?
:href => vdc.task_list.href,
:name => vdc.task_list.name,
:rel => "down" }]
}.flatten }
}.flatten) }
end
end
context "with an organization uri that doesn't exist" do
subject { lambda { @vcloud.get_organization(URI.parse('https://www.fakey.com/api/v0.8/org/999')) } }
it_should_behave_like "a request for a resource that doesn't exist"
it_should_behave_like("a request for a resource that doesn't exist")
end
end
end
else
end

View file

@ -8,7 +8,7 @@ if Fog.mocking?
describe Fog::Vcloud, :type => :mock_vcloud_request do
subject { @vcloud }
it { should respond_to :get_vdc }
it { should respond_to(:get_vdc) }
describe :get_vdc, :type => :vcloud_request do
context "with a valid vdc uri" do
@ -16,14 +16,14 @@ if Fog.mocking?
subject { @vdc }
it_should_behave_like "all responses"
it { should have_headers_denoting_a_content_type_of "application/vnd.vmware.vcloud.vdc+xml" }
it { should have_headers_denoting_a_content_type_of("application/vnd.vmware.vcloud.vdc+xml") }
describe :body do
subject { @vdc.body }
it { should have(16).items }
it_should_behave_like "it has the standard vcloud v0.8 xmlns attributes" # 3 keys
it_should_behave_like("it has the standard vcloud v0.8 xmlns attributes") # 3 keys
its(:name) { should == @mock_vdc.name }
its(:href) { should == @mock_vdc.href }
@ -53,11 +53,10 @@ if Fog.mocking?
end
context "with a vdc uri that doesn't exist" do
subject { lambda { @vcloud.get_vdc(URI.parse('https://www.fakey.com/api/v0.8/vdc/999')) } }
it_should_behave_like "a request for a resource that doesn't exist"
it_should_behave_like("a request for a resource that doesn't exist")
end
end
end
else
end

View file

@ -4,7 +4,7 @@ shared_examples_for "real or mock get_versions requests" do
subject { @vcloud }
it { should respond_to :get_versions }
it { should respond_to(:get_versions) }
describe "#get_versions" do
subject { @vcloud.get_versions( @vcloud.versions_uri ) }
@ -29,7 +29,7 @@ shared_examples_for "real or mock get_versions requests" do
version_info.should include(:LoginUrl)
version_info[:LoginUrl].should be_a_url
version_info.should include(:Version)
version_info[:Version].should be_an_instance_of String
version_info[:Version].should be_an_instance_of(String)
end
}
end

View file

@ -35,33 +35,33 @@ def ecloud_disabled_default_monitor
end
shared_examples_for "all responses" do
it { should be_an_instance_of Excon::Response }
it { should respond_to :body }
it { should respond_to :headers }
it { should be_an_instance_of(Excon::Response) }
it { should respond_to(:body) }
it { should respond_to(:headers) }
it { should have_at_least(1).body }
it { should have_at_least(0).headers }
its(:body) { should be_an_instance_of Hash }
its(:headers) { should be_an_instance_of Hash }
its(:body) { should be_an_instance_of(Hash) }
its(:headers) { should be_an_instance_of(Hash) }
end
shared_examples_for "all delete responses" do
it { should be_an_instance_of Excon::Response }
it { should respond_to :body }
it { should respond_to :headers }
its(:headers) { should be_an_instance_of Hash }
it { should be_an_instance_of(Excon::Response) }
it { should respond_to(:body) }
it { should respond_to(:headers) }
its(:headers) { should be_an_instance_of(Hash) }
end
shared_examples_for "it has a Content-Type header" do
its(:headers) { should include "Content-Type" }
its(:headers) { should include("Content-Type") }
end
shared_examples_for "all rel=down vcloud links" do
it { should be_an_instance_of Struct::VcloudLink }
it { should be_an_instance_of(Struct::VcloudLink) }
specify { subject.rel.should == "down" }
end
shared_examples_for "all vcloud links w/o a rel" do
it { should be_an_instance_of Struct::VcloudLink }
it { should be_an_instance_of(Struct::VcloudLink) }
specify { subject.rel.should == nil }
end
@ -95,21 +95,21 @@ end
shared_examples_for "all login requests" do
it { should respond_to :login }
it { should respond_to(:login) }
describe "#login" do
before { @login = @vcloud.login }
subject { @login }
it_should_behave_like "all responses"
it_should_behave_like("all responses")
its(:headers) { should include "Set-Cookie" }
its(:headers) { should include("Set-Cookie") }
describe "#body" do
subject { @login.body }
it { should have(4).items }
it_should_behave_like "it has the standard vcloud v0.8 xmlns attributes" # 3 keys
it_should_behave_like("it has the standard vcloud v0.8 xmlns attributes") # 3 keys
it { should include(:Org) }
describe ":Org" do
@ -118,11 +118,11 @@ shared_examples_for "all login requests" do
specify do
subject.each do |org|
org.should include(:type)
org[:type].should be_of_type "application/vnd.vmware.vcloud.org+xml"
org[:type].should be_of_type("application/vnd.vmware.vcloud.org+xml")
org.should include(:name)
org[:name].should be_an_instance_of String
org[:name].should be_an_instance_of(String)
org.should include(:href)
org[:href].should be_a_url
org[:href].should(be_a_url)
end
end
end
@ -143,17 +143,17 @@ shared_examples_for "it has the proper xmlns_xsd" do
end
shared_examples_for "it has the standard xmlns attributes" do
it_should_behave_like "it has the proper xmlns_xsi"
it_should_behave_like "it has the proper xmlns_xsd"
it_should_behave_like("it has the proper xmlns_xsi")
it_should_behave_like("it has the proper xmlns_xsd")
end
shared_examples_for "it has the standard vcloud v0.8 xmlns attributes" do
it_should_behave_like "it has a vcloud v0.8 xmlns"
it_should_behave_like "it has the standard xmlns attributes"
it_should_behave_like("it has a vcloud v0.8 xmlns")
it_should_behave_like("it has the standard xmlns attributes")
end
shared_examples_for "a request for a resource that doesn't exist" do
it { should raise_error Excon::Errors::Unauthorized }
it { should raise_error(Excon::Errors::Unauthorized) }
end
shared_examples_for "a vdc catalog link" do
@ -163,8 +163,8 @@ shared_examples_for "a vdc catalog link" do
end
shared_examples_for "a tmrk network link" do
it_should_behave_like "all vcloud links w/o a rel"
it_should_behave_like "all vcloud network types"
it_should_behave_like("all vcloud links w/o a rel")
it_should_behave_like("all vcloud network types")
end
shared_examples_for "the mocked tmrk network links" do
@ -190,22 +190,22 @@ shared_examples_for "the mocked tmrk resource entity links" do
describe "[0]" do
subject { @vdc.body.resource_entities[0] }
it_should_behave_like "a vapp type"
it_should_behave_like "all vcloud links w/o a rel"
it_should_behave_like("a vapp type")
it_should_behave_like("all vcloud links w/o a rel")
its(:href) { should == URI.parse(@mock_vdc[:vms][0][:href]) }
its(:name) { should == @mock_vdc[:vms][0][:name] }
end
describe "[1]" do
subject { @vdc.body.resource_entities[1] }
it_should_behave_like "a vapp type"
it_should_behave_like "all vcloud links w/o a rel"
it_should_behave_like("a vapp type")
it_should_behave_like("all vcloud links w/o a rel")
its(:href) { should == URI.parse(@mock_vdc[:vms][1][:href]) }
its(:name) { should == @mock_vdc[:vms][1][:name] }
end
describe "[2]" do
subject { @vdc.body.resource_entities[2] }
it_should_behave_like "a vapp type"
it_should_behave_like "all vcloud links w/o a rel"
it_should_behave_like("a vapp type")
it_should_behave_like("all vcloud links w/o a rel")
its(:href) { should == URI.parse(@mock_vdc[:vms][2][:href]) }
its(:name) { should == @mock_vdc[:vms][2][:name] }
end

View file

@ -7,8 +7,8 @@ if Fog.mocking?
describe :class do
subject { Fog::Vcloud::Terremark::Ecloud::BackupInternetService }
it { should have_identity :href }
it { should have_only_these_attributes [:href, :name, :id, :protocol, :enabled, :description, :timeout, :redirect_url, :monitor] }
it { should have_identity(:href) }
it { should have_only_these_attributes([:href, :name, :id, :protocol, :enabled, :description, :timeout, :redirect_url, :monitor]) }
end
context "with no uri" do
@ -23,7 +23,7 @@ if Fog.mocking?
let(:composed_service_data) { @vcloud.vdcs[0].backup_internet_services[0].send(:_compose_service_data) }
it { should be_an_instance_of Fog::Vcloud::Terremark::Ecloud::BackupInternetService }
it { should be_an_instance_of(Fog::Vcloud::Terremark::Ecloud::BackupInternetService) }
its(:href) { should == @mock_backup_service.href }
its(:identity) { should == @mock_backup_service.href }
@ -45,5 +45,4 @@ if Fog.mocking?
specify { composed_service_data[:timeout].should == subject.timeout.to_s }
end
end
else
end

View file

@ -5,7 +5,7 @@ if Fog.mocking?
context "as an attribute of a VDC" do
subject { @vcloud.vdcs[0] }
it { should respond_to :backup_internet_services }
it { should respond_to(:backup_internet_services) }
describe :class do
subject { @vcloud.vdcs[0].backup_internet_services.class }
@ -15,15 +15,14 @@ if Fog.mocking?
describe :backup_internet_services do
subject { @vcloud.vdcs[0].backup_internet_services }
it { should respond_to :create }
it { should respond_to(:create) }
it { should be_an_instance_of Fog::Vcloud::Terremark::Ecloud::BackupInternetServices }
it { should be_an_instance_of(Fog::Vcloud::Terremark::Ecloud::BackupInternetServices) }
its(:length) { should == 1 }
it { should have_members_of_the_right_model }
it { should(have_members_of_the_right_model) }
end
end
end
else
end

View file

@ -7,8 +7,8 @@ if Fog.mocking?
describe :class do
subject { Fog::Vcloud::Terremark::Ecloud::InternetService }
it { should have_identity :href }
it { should have_only_these_attributes [:href, :name, :id, :protocol, :port, :enabled, :description, :public_ip, :timeout, :redirect_url, :monitor, :backup_service_data] }
it { should have_identity(:href) }
it { should have_only_these_attributes([:href, :name, :id, :protocol, :port, :enabled, :description, :public_ip, :timeout, :redirect_url, :monitor, :backup_service_data]) }
end
context "with no uri" do
@ -29,7 +29,7 @@ if Fog.mocking?
let(:composed_public_ip_data) { @vcloud.vdcs[0].public_ips[0].internet_services[0].send(:_compose_ip_data) }
let(:composed_service_data) { @vcloud.vdcs[0].public_ips[0].internet_services[0].send(:_compose_service_data) }
it { should be_an_instance_of Fog::Vcloud::Terremark::Ecloud::InternetService }
it { should be_an_instance_of(Fog::Vcloud::Terremark::Ecloud::InternetService) }
its(:href) { should == @mock_service.href }
its(:identity) { should == @mock_service.href }

View file

@ -5,7 +5,7 @@ if Fog.mocking?
context "as an attribute of a VDC" do
subject { @vcloud.vdcs[0] }
it { should respond_to :internet_services }
it { should respond_to(:internet_services) }
describe :class do
subject { @vcloud.vdcs[0].internet_services.class }
@ -15,9 +15,9 @@ if Fog.mocking?
describe :internet_services do
subject { @vcloud.vdcs[0].internet_services }
it { should respond_to :create }
it { should respond_to(:create) }
it { should be_an_instance_of Fog::Vcloud::Terremark::Ecloud::InternetServices }
it { should be_an_instance_of(Fog::Vcloud::Terremark::Ecloud::InternetServices) }
its(:length) { should == 4 }

View file

@ -7,8 +7,8 @@ if Fog.mocking?
describe :class do
subject { Fog::Vcloud::Terremark::Ecloud::Ip }
it { should have_identity :href }
it { should have_only_these_attributes [:href, :name, :status, :server, :rnat, :id] }
it { should have_identity(:href) }
it { should have_only_these_attributes([:href, :name, :status, :server, :rnat, :id]) }
end
context "with no uri" do
@ -20,7 +20,7 @@ if Fog.mocking?
context "as a collection member" do
subject { @ip = @vcloud.vdcs[0].networks[0].ips[0] }
it { should be_an_instance_of Fog::Vcloud::Terremark::Ecloud::Ip }
it { should be_an_instance_of(Fog::Vcloud::Terremark::Ecloud::Ip) }
its(:name) { should == @mock_data.network_ip_from_href(@ip.href).name }
its(:status) { should == @mock_data.network_ip_from_href(@ip.href).status }

View file

@ -4,7 +4,7 @@ if Fog.mocking?
describe "Fog::Vcloud::Terremark::Ecloud::Ips", :type => :mock_tmrk_ecloud_model do
subject { @vcloud }
it { should respond_to :ips }
it { should respond_to(:ips) }
describe :class do
subject { @vcloud.vdcs[0].networks[0].ips.class }
@ -13,9 +13,9 @@ if Fog.mocking?
describe :ips do
subject { @vcloud.vdcs[0].networks[0].ips.reload }
it { should_not respond_to :create }
it { should_not respond_to(:create) }
it { should be_an_instance_of Fog::Vcloud::Terremark::Ecloud::Ips }
it { should be_an_instance_of(Fog::Vcloud::Terremark::Ecloud::Ips) }
its(:length) { should == 252 }

View file

@ -7,8 +7,8 @@ if Fog.mocking?
describe :class do
subject { Fog::Vcloud::Terremark::Ecloud::Network }
it { should have_identity :href }
it { should have_only_these_attributes [:href, :name, :features, :links, :type, :gateway, :broadcast, :address, :rnat, :extension_href, :network_type, :vlan, :friendly_name] }
it { should have_identity(:href) }
it { should have_only_these_attributes([:href, :name, :features, :links, :type, :gateway, :broadcast, :address, :rnat, :extension_href, :network_type, :vlan, :friendly_name]) }
end
context "with no uri" do
@ -21,7 +21,7 @@ if Fog.mocking?
context "as a collection member" do
subject { @vcloud.vdcs[0].networks[0].reload }
it { should be_an_instance_of Fog::Vcloud::Terremark::Ecloud::Network }
it { should be_an_instance_of(Fog::Vcloud::Terremark::Ecloud::Network) }
its(:href) { should == @mock_network.href }
its(:identity) { should == @mock_network.href }
@ -40,7 +40,7 @@ if Fog.mocking?
describe :features do
let(:feature) { subject.features.first }
specify { feature.should be_an_instance_of Array }
specify { feature.should be_an_instance_of(Array) }
specify { feature.last.should == @mock_network.features[0][:value] }
end

View file

@ -4,7 +4,7 @@ if Fog.mocking?
describe "Fog::Vcloud::Terremark::Ecloud::Networks", :type => :mock_tmrk_ecloud_model do
subject { @vcloud }
it { should respond_to :networks }
it { should respond_to(:networks) }
describe :class do
subject { @vcloud.networks.class }
@ -13,9 +13,9 @@ if Fog.mocking?
describe :networks do
subject { @vcloud.vdcs[0].networks }
it { should_not respond_to :create }
it { should_not respond_to(:create) }
it { should be_an_instance_of Fog::Vcloud::Terremark::Ecloud::Networks }
it { should be_an_instance_of(Fog::Vcloud::Terremark::Ecloud::Networks) }
its(:length) { should == 2 }

View file

@ -8,8 +8,8 @@ if Fog.mocking?
describe :class do
subject { Fog::Vcloud::Terremark::Ecloud::Node }
it { should have_identity :href }
it { should have_only_these_attributes [:href, :ip_address, :description, :name, :port, :enabled, :id] }
it { should have_identity(:href) }
it { should have_only_these_attributes([:href, :ip_address, :description, :name, :port, :enabled, :id]) }
end
context "with no uri" do
@ -22,7 +22,7 @@ if Fog.mocking?
context "as a collection member" do
subject { @vcloud.vdcs.first.public_ips.first.internet_services.first.nodes.first.reload }
it { should be_an_instance_of Fog::Vcloud::Terremark::Ecloud::Node }
it { should be_an_instance_of(Fog::Vcloud::Terremark::Ecloud::Node) }
its(:href) { should == @mock_node.href }
its(:identity) { should == @mock_node.href }

View file

@ -5,7 +5,7 @@ if Fog.mocking?
context "as an attribute of an internet_service" do
subject { @vcloud.vdcs.first.public_ips.first.internet_services.first }
it { should respond_to :nodes }
it { should respond_to(:nodes) }
describe :class do
subject { @vcloud.vdcs.first.public_ips.first.internet_services.first.nodes.class }
@ -15,9 +15,9 @@ if Fog.mocking?
describe :nodes do
subject { @vcloud.vdcs.first.public_ips.first.internet_services.first.nodes }
it { should respond_to :create }
it { should respond_to(:create) }
it { should be_an_instance_of Fog::Vcloud::Terremark::Ecloud::Nodes }
it { should be_an_instance_of(Fog::Vcloud::Terremark::Ecloud::Nodes) }
its(:length) { should == 3 }
@ -25,5 +25,4 @@ if Fog.mocking?
end
end
end
else
end

View file

@ -7,8 +7,8 @@ if Fog.mocking?
describe :class do
subject { Fog::Vcloud::Terremark::Ecloud::PublicIp }
it { should have_identity :href }
it { should have_only_these_attributes [:name, :id, :href] }
it { should have_identity(:href) }
it { should have_only_these_attributes([:name, :id, :href]) }
end
context "with no uri" do
@ -21,7 +21,7 @@ if Fog.mocking?
context "as a collection member" do
subject { @vcloud.vdcs[0].public_ips[0].reload; @vcloud.vdcs[0].public_ips[0] }
it { should be_an_instance_of Fog::Vcloud::Terremark::Ecloud::PublicIp }
it { should be_an_instance_of(Fog::Vcloud::Terremark::Ecloud::PublicIp) }
its(:href) { should == @mock_public_ip.href }
its(:identity) { should == @mock_public_ip.href }

View file

@ -4,7 +4,7 @@ if Fog.mocking?
describe "Fog::Vcloud::Terremark::Ecloud::PublicIps", :type => :mock_tmrk_ecloud_model do
subject { @vcloud }
it { should respond_to :public_ips }
it { should respond_to(:public_ips) }
describe :class do
subject { @vcloud.public_ips.class }
@ -13,9 +13,9 @@ if Fog.mocking?
describe :public_ips do
subject { @vcloud.vdcs[0].public_ips }
it { should_not respond_to :create }
it { should_not respond_to(:create) }
it { should be_an_instance_of Fog::Vcloud::Terremark::Ecloud::PublicIps }
it { should be_an_instance_of(Fog::Vcloud::Terremark::Ecloud::PublicIps) }
its(:length) { should == 3 }

View file

@ -7,8 +7,8 @@ if Fog.mocking?
describe :class do
subject { Fog::Vcloud::Terremark::Ecloud::Server }
it { should have_identity :href }
it { should have_only_these_attributes [:href, :type, :name, :status, :network_connections, :os, :virtual_hardware, :storage_size, :links] }
it { should have_identity(:href) }
it { should have_only_these_attributes([:href, :type, :name, :status, :network_connections, :os, :virtual_hardware, :storage_size, :links]) }
end
context "with no uri" do

View file

@ -4,14 +4,14 @@ if Fog.mocking?
describe "Fog::Vcloud::Terremark::Ecloud::Vdc", :type => :mock_tmrk_ecloud_model do
subject { @vcloud }
it { should respond_to :get_vdc }
it { should respond_to(:get_vdc) }
describe :class do
subject { Fog::Vcloud::Terremark::Ecloud::Vdc }
it { should have_identity :href }
it { should have_only_these_attributes [:href, :name, :type, :description, :other_links, :compute_capacity, :storage_capacity, :available_networks,
:resource_entities, :deployed_vm_quota, :instantiated_vm_quota] }
it { should have_identity(:href) }
it { should have_only_these_attributes([:href, :name, :type, :description, :other_links, :compute_capacity, :storage_capacity, :available_networks,
:resource_entities, :deployed_vm_quota, :instantiated_vm_quota]) }
end
context "with no uri" do
@ -27,7 +27,7 @@ if Fog.mocking?
its(:href) { should == @mock_vdc.href }
its(:identity) { should == @mock_vdc.href }
its(:name) { should == @mock_vdc.name }
its(:public_ips) { should be_an_instance_of Fog::Vcloud::Terremark::Ecloud::PublicIps }
its(:public_ips) { should be_an_instance_of(Fog::Vcloud::Terremark::Ecloud::PublicIps) }
its(:other_links) { should have(4).items }
its(:resource_entities) { should have(3).items }
its(:available_networks) { should have(2).items }

View file

@ -4,7 +4,7 @@ if Fog.mocking?
describe "Fog::Vcloud::Terremark::Ecloud::Vdcs", :type => :mock_tmrk_ecloud_model do
subject { @vcloud }
it { should respond_to :vdcs }
it { should respond_to(:vdcs) }
describe :class do
subject { @vcloud.vdcs.class }
@ -13,9 +13,9 @@ if Fog.mocking?
describe :vdcs do
subject { @vcloud.vdcs }
it { should_not respond_to :create }
it { should_not respond_to(:create) }
it { should be_an_instance_of Fog::Vcloud::Terremark::Ecloud::Vdcs }
it { should be_an_instance_of(Fog::Vcloud::Terremark::Ecloud::Vdcs) }
its(:length) { should == 2 }

View file

@ -4,7 +4,7 @@ if Fog.mocking?
describe "Fog::Vcloud, initialized w/ the TMRK Ecloud module", :type => :mock_tmrk_ecloud_request do
subject { @vcloud }
it { should respond_to :add_backup_internet_service }
it { should respond_to(:add_backup_internet_service) }
describe "#add_backup_internet_service" do
before do
@ -28,7 +28,7 @@ if Fog.mocking?
let(:body) { subject.body }
its(:body) { should be_an_instance_of Hash }
its(:body) { should be_an_instance_of(Hash) }
specify { body[:Href].should_not be_empty }
specify { body[:Name].should == @new_backup_service_data[:name] }
specify { body[:Protocol].should == @new_backup_service_data[:protocol] }

View file

@ -4,7 +4,7 @@ if Fog.mocking?
describe "Fog::Vcloud, initialized w/ the TMRK Ecloud module", :type => :mock_tmrk_ecloud_request do
subject { @vcloud }
it { should respond_to :add_internet_service }
it { should respond_to(:add_internet_service) }
describe "#add_internet_service" do
before do
@ -29,7 +29,7 @@ if Fog.mocking?
let(:body) { subject.body }
its(:body) { should be_an_instance_of Hash }
its(:body) { should be_an_instance_of(Hash) }
specify { body[:Href].should_not be_empty }
specify { body[:Name].should == @new_service_data[:name] }
specify { body[:Protocol].should == @new_service_data[:protocol] }
@ -39,7 +39,7 @@ if Fog.mocking?
specify { body[:Monitor].should == nil }
let(:referenced_public_ip) { subject.body[:PublicIpAddress] }
specify { referenced_public_ip.should be_an_instance_of Hash }
specify { referenced_public_ip.should be_an_instance_of(Hash) }
specify { referenced_public_ip[:Name].should == @public_ip.name }
specify { referenced_public_ip[:Id].should == @public_ip.id }

View file

@ -5,7 +5,7 @@ if Fog.mocking?
describe "Fog::Vcloud, initialized w/ the TMRK Ecloud module", :type => :mock_tmrk_ecloud_request do
subject { @vcloud }
it { should respond_to :add_node }
it { should respond_to(:add_node) }
describe "#add_node" do

View file

@ -4,7 +4,7 @@ if Fog.mocking?
describe "Fog::Vcloud, initialized w/ the TMRK Ecloud module", :type => :mock_tmrk_ecloud_request do
subject { @vcloud }
it { should respond_to :configure_internet_service }
it { should respond_to(:configure_internet_service) }
describe "#configure_internet_service" do
before do

View file

@ -4,7 +4,7 @@ if Fog.mocking?
describe "Fog::Vcloud, initialized w/ the TMRK Ecloud module", :type => :mock_tmrk_ecloud_request do
subject { @vcloud }
it { should respond_to :configure_network_ip }
it { should respond_to(:configure_network_ip) }
describe "#configure_network_ip" do
let(:original_network_ip) { @vcloud.get_network_ip(@mock_network_ip.href).body }

View file

@ -4,7 +4,7 @@ if Fog.mocking?
describe "Fog::Vcloud, initialized w/ the TMRK Ecloud module", :type => :mock_tmrk_ecloud_request do
subject { @vcloud }
it { should respond_to :configure_node }
it { should respond_to(:configure_node) }
describe "#configure_node" do
let(:original_node) { @vcloud.get_node(@mock_node.href).body }

View file

@ -8,7 +8,7 @@ shared_examples_for "a successful configure vapp" do
end
describe "#headers" do
its(:headers) { should include "Location" }
its(:headers) { should include("Location") }
end
end
@ -16,7 +16,7 @@ if Fog.mocking?
describe "Fog::Vcloud, initialized w/ the TMRK Ecloud module", :type => :mock_tmrk_ecloud_request do
subject { @vcloud }
it { should respond_to :configure_vapp }
it { should respond_to(:configure_vapp) }
let(:original_vapp_data) { vapp_data.dup }
let(:vapp_data) { @mock_vm.to_configure_vapp_hash }

View file

@ -5,7 +5,7 @@ if Fog.mocking?
describe "Fog::Vcloud, initialized w/ the TMRK Ecloud module", :type => :mock_tmrk_ecloud_request do
subject { @vcloud }
it { should respond_to :delete_internet_service }
it { should respond_to(:delete_internet_service) }
describe "#delete_internet_service" do
context "with a valid internet service uri" do

View file

@ -5,7 +5,7 @@ if Fog.mocking?
describe "Fog::Vcloud, initialized w/ the TMRK Ecloud module", :type => :mock_tmrk_ecloud_request do
subject { @vcloud }
it { should respond_to :delete_node }
it { should respond_to(:delete_node) }
describe "#delete_node" do
context "with a valid node service uri" do

View file

@ -14,7 +14,7 @@ shared_examples_for "a failed vapp deletion" do
end
describe "#headers" do
its(:headers) { should_not include "Location" }
its(:headers) { should_not include("Location") }
end
end
@ -23,7 +23,7 @@ if Fog.mocking?
describe "Fog::Vcloud, initialized w/ the TMRK Ecloud module", :type => :mock_tmrk_ecloud_request do
subject { @vcloud }
it { should respond_to :delete_vapp }
it { should respond_to(:delete_vapp) }
describe "#delete_vapp" do
context "with a valid vapp uri" do
@ -31,7 +31,7 @@ if Fog.mocking?
let(:vdc) { @vcloud.vdcs.first }
context "when there are no internet service nodes attached" do
it_should_behave_like "all delete responses"
it_should_behave_like("all delete responses")
it "should change the mock data" do
expect { subject }.to change { @mock_vdc.virtual_machines.count }.by(-1)
@ -46,7 +46,7 @@ if Fog.mocking?
end
describe "#headers" do
its(:headers) { should include "Location" }
its(:headers) { should include("Location") }
end
end

View file

@ -4,7 +4,7 @@ if Fog.mocking?
describe "Fog::Vcloud, initialized w/ the TMRK Ecloud module", :type => :mock_tmrk_ecloud_request do
subject { @vcloud }
it { should respond_to :get_catalog_item }
it { should respond_to(:get_catalog_item) }
describe "#get_catalog_item" do
context "with a valid catalog_item_uri" do
@ -13,20 +13,20 @@ if Fog.mocking?
let(:mock_data_catalog_item) { @mock_data.catalog_item_from_href(@catalog_item.body[:href]) }
it_should_behave_like "all responses"
it { should have_headers_denoting_a_content_type_of "application/vnd.vmware.vcloud.catalogItem+xml" }
it { should have_headers_denoting_a_content_type_of("application/vnd.vmware.vcloud.catalogItem+xml") }
describe "#body" do
subject { @catalog_item.body }
it { should have(8).items }
it_should_behave_like "it has the standard vcloud v0.8 xmlns attributes" # 3 keys
it_should_behave_like("it has the standard vcloud v0.8 xmlns attributes") # 3 keys
its(:name) { should == "Item 0" }
it { should include :Entity }
it { should include :Link }
it { should include :Property }
it { should include(:Entity) }
it { should include(:Link) }
it { should include(:Property) }
describe "Entity" do
subject { @catalog_item.body[:Entity] }
@ -55,9 +55,8 @@ if Fog.mocking?
context "with a catalog uri that doesn't exist" do
subject { lambda { @vcloud.get_catalog(URI.parse('https://www.fakey.com/api/v0.8/vdc/999/catalog')) } }
it_should_behave_like "a request for a resource that doesn't exist"
it_should_behave_like("a request for a resource that doesn't exist")
end
end
end
else
end

View file

@ -4,7 +4,7 @@ if Fog.mocking?
describe "Fog::Vcloud, initialized w/ the TMRK Ecloud module", :type => :mock_tmrk_ecloud_request do
subject { @vcloud }
it { should respond_to :get_catalog }
it { should respond_to(:get_catalog) }
describe "#get_catalog" do
context "with a valid vdc catalog_uri" do
@ -12,7 +12,7 @@ if Fog.mocking?
subject { @catalog }
it_should_behave_like "all responses"
it { should have_headers_denoting_a_content_type_of "application/vnd.vmware.vcloud.catalog+xml" }
it { should have_headers_denoting_a_content_type_of("application/vnd.vmware.vcloud.catalog+xml") }
describe "#body" do
subject { @catalog.body }
@ -23,7 +23,7 @@ if Fog.mocking?
its(:name) { should == @mock_vdc.catalog.name }
it { should include :CatalogItems }
it { should include(:CatalogItems) }
describe "CatalogItems" do
subject { @catalog.body[:CatalogItems] }

View file

@ -4,7 +4,7 @@ if Fog.mocking?
describe "Fog::Vcloud, initialized w/ the TMRK Ecloud module", :type => :mock_tmrk_ecloud_request do
subject { @vcloud }
it { should respond_to :get_customization_options }
it { should respond_to(:get_customization_options) }
describe "#get_customization_options" do
context "with a valid catalog_item customizations uri" do
@ -14,7 +14,7 @@ if Fog.mocking?
subject { @customization_options }
it_should_behave_like "all responses"
it { should have_headers_denoting_a_content_type_of "application/vnd.tmrk.ecloud.catalogItemCustomizationParameters+xml" }
it { should have_headers_denoting_a_content_type_of("application/vnd.tmrk.ecloud.catalogItemCustomizationParameters+xml") }
describe "#body" do
subject { @customization_options.body }

View file

@ -2,13 +2,13 @@ require 'vcloud/spec_helper'
if Fog.mocking?
shared_examples_for "a basic internet service" do
specify { service.should be_an_instance_of Hash }
specify { service.should be_an_instance_of(Hash) }
specify { service.should have(14).attributes }
specify { service[:Name].should == mock_service.name }
specify { service[:Id].should == mock_service.object_id.to_s }
specify { service[:Href].should == mock_service.href }
specify { service[:PublicIpAddress].should be_an_instance_of Hash }
specify { service[:PublicIpAddress].should be_an_instance_of(Hash) }
specify { service[:PublicIpAddress].should have(3).attributes }
specify { service[:PublicIpAddress][:Name].should == mock_ip.name }
specify { service[:PublicIpAddress][:Href].should == mock_ip.href }
@ -30,13 +30,13 @@ if Fog.mocking?
end
shared_examples_for "an internet service with a backup internet service set" do
specify { service[:BackupService].should be_an_instance_of Hash }
specify { service[:BackupService].should include :Href }
specify { service[:BackupService].should be_an_instance_of(Hash) }
specify { service[:BackupService].should include(:Href) }
specify { service[:BackupService][:Href].should == @mock_backup_service.href }
end
shared_examples_for "a backup internet service" do
specify { service.should be_an_instance_of Hash }
specify { service.should be_an_instance_of(Hash) }
specify { service.should have(14).attributes }
specify { service[:Name].should == mock_service.name }
specify { service[:Id].should == mock_service.object_id.to_s }
@ -59,7 +59,7 @@ if Fog.mocking?
describe "Fog::Vcloud, initialized w/ the TMRK Ecloud module", :type => :mock_tmrk_ecloud_request do
subject { @vcloud }
it { should respond_to :get_internet_services }
it { should respond_to(:get_internet_services) }
describe "#get_internet_services" do
context "with a valid VDC internet_services_uri" do
@ -71,7 +71,7 @@ if Fog.mocking?
subject { @services }
it_should_behave_like "all responses"
it { should have_headers_denoting_a_content_type_of "application/vnd.tmrk.ecloud.internetServicesList+xml" }
it { should have_headers_denoting_a_content_type_of("application/vnd.tmrk.ecloud.internetServicesList+xml") }
describe "#body" do
subject { @services.body }
@ -96,14 +96,14 @@ if Fog.mocking?
let(:mock_service) { @mock_vdc.internet_service_collection.items[3] }
let(:mock_ip) { mock_service._parent._parent }
it_should_behave_like "an internet service with a backup internet service set"
it_should_behave_like("an internet service with a backup internet service set")
end
context "for a backup internet service" do
let(:service) { subject[4] }
let(:mock_service) { @mock_vdc.internet_service_collection.backup_internet_services.first }
it_should_behave_like "a backup internet service"
it_should_behave_like("a backup internet service")
end
end
end
@ -115,8 +115,8 @@ if Fog.mocking?
end
subject { @services }
it_should_behave_like "all responses"
it { should have_headers_denoting_a_content_type_of "application/vnd.tmrk.ecloud.internetServicesList+xml" }
it_should_behave_like("all responses")
it { should have_headers_denoting_a_content_type_of("application/vnd.tmrk.ecloud.internetServicesList+xml") }
describe "#body" do
subject { @services.body }
@ -133,7 +133,7 @@ if Fog.mocking?
let(:mock_service) { @mock_service_collection.items[idx] }
let(:mock_ip) { @mock_public_ip }
it_should_behave_like "an internet service without a backup internet service set"
it_should_behave_like("an internet service without a backup internet service set")
end
end
end
@ -142,7 +142,7 @@ if Fog.mocking?
context "with a public_ips_uri that doesn't exist" do
subject { lambda { @vcloud.get_internet_services(URI.parse('https://www.fakey.c/piv8vc99')) } }
it_should_behave_like "a request for a resource that doesn't exist"
it_should_behave_like("a request for a resource that doesn't exist")
end
end
end

View file

@ -4,7 +4,7 @@ if Fog.mocking?
describe "Fog::Vcloud, initialized w/ the TMRK Ecloud module", :type => :mock_tmrk_ecloud_request do
subject { @vcloud }
it { should respond_to :get_network_ip }
it { should respond_to(:get_network_ip) }
describe "#get_network_ip" do
context "with a valid ip_uri" do
@ -15,7 +15,7 @@ if Fog.mocking?
subject { @ip }
it_should_behave_like "all responses"
it { should have_headers_denoting_a_content_type_of "application/vnd.tmrk.ecloud.ip+xml" }
it { should have_headers_denoting_a_content_type_of("application/vnd.tmrk.ecloud.ip+xml") }
describe "#body" do
subject { @ip.body }

View file

@ -4,7 +4,7 @@ if Fog.mocking?
describe "Fog::Vcloud, initialized w/ the TMRK Ecloud module", :type => :mock_tmrk_ecloud_request do
subject { @vcloud }
it { should respond_to :get_network_ips }
it { should respond_to(:get_network_ips) }
describe "#get_network_ips" do
context "with a valid VDC network ips_uri" do
@ -12,7 +12,7 @@ if Fog.mocking?
subject { @ips }
it_should_behave_like "all responses"
it { should have_headers_denoting_a_content_type_of "application/vnd.tmrk.ecloud.ipAddressesList+xml" }
it { should have_headers_denoting_a_content_type_of("application/vnd.tmrk.ecloud.ipAddressesList+xml") }
describe "#body" do
subject { @ips.body }
@ -51,9 +51,8 @@ if Fog.mocking?
context "with a network ips uri that doesn't exist" do
subject { lambda { @vcloud.get_network_ips(URI.parse('https://www.fakey.c/piv8vc99')) } }
it_should_behave_like "a request for a resource that doesn't exist"
it_should_behave_like("a request for a resource that doesn't exist")
end
end
end
else
end

View file

@ -4,7 +4,7 @@ if Fog.mocking?
describe "Fog::Vcloud, initialized w/ the TMRK Ecloud module", :type => :mock_tmrk_ecloud_request do
subject { @vcloud }
it { should respond_to :get_network }
it { should respond_to(:get_network) }
describe "#get_network" do
context "with a valid network uri" do
@ -12,7 +12,7 @@ if Fog.mocking?
subject { @network }
it_should_behave_like "all responses"
it { should have_headers_denoting_a_content_type_of "application/vnd.vmware.vcloud.network+xml" }
it { should have_headers_denoting_a_content_type_of("application/vnd.vmware.vcloud.network+xml") }
describe "#body" do
subject { @network.body }

View file

@ -4,7 +4,7 @@ if Fog.mocking?
describe "Fog::Vcloud, initialized w/ the TMRK Ecloud module", :type => :mock_tmrk_ecloud_request do
subject { @vcloud }
it { should respond_to :get_node }
it { should respond_to(:get_node) }
describe "#get_node" do
context "with a valid nodes_uri" do
@ -12,7 +12,7 @@ if Fog.mocking?
subject { @node }
it_should_behave_like "all responses"
it { should have_headers_denoting_a_content_type_of "application/vnd.tmrk.ecloud.nodeService+xml" }
it { should have_headers_denoting_a_content_type_of("application/vnd.tmrk.ecloud.nodeService+xml") }
describe "#body" do
subject { @node.body }

View file

@ -4,7 +4,7 @@ if Fog.mocking?
describe "Fog::Vcloud, initialized w/ the TMRK Ecloud module", :type => :mock_tmrk_ecloud_request do
subject { @vcloud }
it { should respond_to :get_nodes }
it { should respond_to(:get_nodes) }
describe "#get_nodes" do
context "with a valid nodes_uri" do
@ -12,7 +12,7 @@ if Fog.mocking?
subject { @nodes }
it_should_behave_like "all responses"
it { should have_headers_denoting_a_content_type_of "application/vnd.tmrk.ecloud.nodeService+xml" }
it { should have_headers_denoting_a_content_type_of("application/vnd.tmrk.ecloud.nodeService+xml") }
describe "#body" do
subject { @nodes.body }

View file

@ -4,7 +4,7 @@ if Fog.mocking?
describe "Fog::Vcloud, initialized w/ the TMRK Ecloud module", :type => :mock_tmrk_ecloud_request do
subject { @vcloud }
it { should respond_to :get_public_ip }
it { should respond_to(:get_public_ip) }
describe "#get_public_ip" do
context "with a valid public_ip_uri" do
@ -15,7 +15,7 @@ if Fog.mocking?
subject { @public_ip }
it_should_behave_like "all responses"
it { should have_headers_denoting_a_content_type_of "application/vnd.tmrk.ecloud.publicIp+xml" }
it { should have_headers_denoting_a_content_type_of("application/vnd.tmrk.ecloud.publicIp+xml") }
describe "#body" do
subject { @public_ip.body }

View file

@ -4,7 +4,7 @@ if Fog.mocking?
describe "Fog::Vcloud, initialized w/ the TMRK Ecloud module", :type => :mock_tmrk_ecloud_request do
subject { @vcloud }
it { should respond_to :get_public_ips }
it { should respond_to(:get_public_ips) }
describe "#get_public_ips" do
context "with a valid public_ips_uri" do
@ -12,7 +12,7 @@ if Fog.mocking?
subject { @public_ips }
it_should_behave_like "all responses"
it { should have_headers_denoting_a_content_type_of "application/vnd.tmrk.ecloud.publicIpsList+xml" }
it { should have_headers_denoting_a_content_type_of("application/vnd.tmrk.ecloud.publicIpsList+xml") }
describe "#body" do
subject { @public_ips.body }

View file

@ -4,7 +4,7 @@ if Fog.mocking?
describe "Fog::Vcloud, initialized w/ the TMRK Ecloud module", :type => :mock_tmrk_ecloud_request do
subject { @vcloud }
it { should respond_to :get_vapp }
it { should respond_to(:get_vapp) }
describe "#get_vapp" do
context "with a valid vapp_uri" do
@ -13,7 +13,7 @@ if Fog.mocking?
let(:vapp_id) { @vapp.body[:href].split("/").last }
it_should_behave_like "all responses"
it { should have_headers_denoting_a_content_type_of "application/vnd.vmware.vcloud.vApp+xml" }
it { should have_headers_denoting_a_content_type_of("application/vnd.vmware.vcloud.vApp+xml") }
describe "#body" do
subject { @vapp.body }
@ -25,7 +25,7 @@ if Fog.mocking?
:type, :xmlns,
:xmlns_xsd, :xmlns_xsi] }
it_should_behave_like "it has the standard vcloud v0.8 xmlns attributes" # 3 keys
it_should_behave_like("it has the standard vcloud v0.8 xmlns attributes") # 3 keys
its(:href) { should == @mock_vm.href }
its(:name) { should == @mock_vm.name }
@ -43,7 +43,7 @@ if Fog.mocking?
describe "NetworkConnectionSection" do
subject { @vapp.body[:NetworkConnectionSection] }
it { should include :NetworkConnection }
it { should include(:NetworkConnection) }
describe "NetworkConnection" do
subject { @vapp.body[:NetworkConnectionSection][:NetworkConnection] }
@ -118,9 +118,8 @@ if Fog.mocking?
context "with a vapp uri that doesn't exist" do
subject { lambda { @vcloud.get_vapp(URI.parse('https://www.fakey.com/api/v0.8/vApp/99999')) } }
it_should_behave_like "a request for a resource that doesn't exist"
it_should_behave_like("a request for a resource that doesn't exist")
end
end
end
else
end

View file

@ -4,7 +4,7 @@ if Fog.mocking?
describe "Fog::Vcloud, initialized w/ the TMRK Ecloud module", :type => :mock_tmrk_ecloud_request do
subject { @vcloud }
it { should respond_to :get_vdc }
it { should respond_to(:get_vdc) }
describe "#get_vdc" do
context "with a valid vdc uri" do
@ -12,14 +12,14 @@ if Fog.mocking?
subject { @vdc }
it_should_behave_like "all responses"
it { should have_headers_denoting_a_content_type_of "application/vnd.vmware.vcloud.vdc+xml" }
it { should have_headers_denoting_a_content_type_of("application/vnd.vmware.vcloud.vdc+xml") }
describe "#body" do
subject { @vdc.body }
it { should have(11).items }
it_should_behave_like "it has the standard vcloud v0.8 xmlns attributes" # 3 keys
it_should_behave_like("it has the standard vcloud v0.8 xmlns attributes") # 3 keys
its(:href) { should == @mock_vdc.href }
its(:name) { should == @mock_vdc.name }
@ -72,15 +72,15 @@ if Fog.mocking?
describe "[:ResourceEntities][:ResourceEntity]" do
context "[0]" do
subject { @vdc.body[:ResourceEntities][:ResourceEntity][0] }
it { should be_a_vapp_link_to @mock_vdc.virtual_machines[0] }
it { should be_a_vapp_link_to(@mock_vdc.virtual_machines[0]) }
end
context "[1]" do
subject { @vdc.body[:ResourceEntities][:ResourceEntity][1] }
it { should be_a_vapp_link_to @mock_vdc.virtual_machines[1] }
it { should be_a_vapp_link_to(@mock_vdc.virtual_machines[1]) }
end
context "[2]" do
subject { @vdc.body[:ResourceEntities][:ResourceEntity][2] }
it { should be_a_vapp_link_to @mock_vdc.virtual_machines[2] }
it { should be_a_vapp_link_to(@mock_vdc.virtual_machines[2]) }
end
end
@ -92,11 +92,11 @@ if Fog.mocking?
describe "[:AvailableNetworks][:Network]" do
context "[0]" do
subject { @vdc.body[:AvailableNetworks][:Network][0] }
it { should be_a_network_link_to @mock_vdc.networks[0] }
it { should be_a_network_link_to(@mock_vdc.networks[0]) }
end
context "[1]" do
subject { @vdc.body[:AvailableNetworks][:Network][1] }
it { should be_a_network_link_to @mock_vdc.networks[1] }
it { should be_a_network_link_to(@mock_vdc.networks[1]) }
end
end
end
@ -105,9 +105,8 @@ if Fog.mocking?
context "with a vdc uri that doesn't exist" do
subject { lambda { @vcloud.get_vdc(URI.parse('https://www.fakey.com/api/v0.8/vdc/999')) } }
it_should_behave_like "a request for a resource that doesn't exist"
it_should_behave_like("a request for a resource that doesn't exist")
end
end
end
else
end

View file

@ -4,7 +4,7 @@ if Fog.mocking?
describe "Fog::Vcloud, initialized w/ the TMRK Ecloud module", :type => :mock_tmrk_ecloud_request do
subject { @vcloud }
it { should respond_to :instantiate_vapp_template }
it { should respond_to(:instantiate_vapp_template) }
describe "#instantiate_vapp_template" do
let(:vdc) { @vcloud.vdcs.first }
@ -32,7 +32,7 @@ if Fog.mocking?
subject { template_instantiation }
it_should_behave_like "all responses"
it { should have_headers_denoting_a_content_type_of "application/xml" }
it { should have_headers_denoting_a_content_type_of("application/xml") }
it "updates the mock data properly" do
expect { subject }.to change { mock_vdc.virtual_machines.size }.by(1)
@ -42,7 +42,7 @@ if Fog.mocking?
before { template_instantiation }
subject { added_mock_data }
it { should be_an_instance_of Fog::Vcloud::MockDataClasses::MockVirtualMachine }
it { should be_an_instance_of(Fog::Vcloud::MockDataClasses::MockVirtualMachine) }
its(:name) { should == new_vapp_data[:name] }
its(:memory) { should == new_vapp_data[:memory] }
@ -68,7 +68,7 @@ if Fog.mocking?
it { should have(9).items }
it_should_behave_like "it has the standard vcloud v0.8 xmlns attributes" # 3 keys
it_should_behave_like("it has the standard vcloud v0.8 xmlns attributes") # 3 keys
its(:href) { should == added_mock_data.href }
its(:type) { should == "application/vnd.vmware.vcloud.vApp+xml" }
@ -76,7 +76,7 @@ if Fog.mocking?
its(:status) { should == "0" }
its(:size) { should == "4" }
it { should include :Link }
it { should include(:Link) }
describe "Link" do
subject { template_instantiation.body[:Link] }
@ -92,5 +92,4 @@ if Fog.mocking?
end
end
end
else
end

View file

@ -4,7 +4,7 @@ if Fog.mocking?
describe Fog::Vcloud, :type => :mock_tmrk_ecloud_request do
subject { @vcloud }
it { should respond_to :power_off }
it { should respond_to(:power_off) }
describe :power_off, :type => :vcloud_request do
context "with a valid vapp uri" do

View file

@ -4,7 +4,7 @@ if Fog.mocking?
describe Fog::Vcloud, :type => :mock_tmrk_ecloud_request do
subject { @vcloud }
it { should respond_to :power_on }
it { should respond_to(:power_on) }
describe :power_on, :type => :vcloud_request do
context "with a valid vapp uri" do

View file

@ -4,11 +4,11 @@ if Fog.mocking?
describe Fog::Vcloud, :type => :mock_vcloud_request do
subject { Fog::Vcloud.new(:username => "foo", :password => "bar", :versions_uri => "https://fakey.com/api/versions") }
it { should be_an_instance_of Fog::Vcloud::Mock }
it { should be_an_instance_of(Fog::Vcloud::Mock) }
it { should respond_to :default_organization_uri }
it { should respond_to(:default_organization_uri) }
it { should respond_to :supported_versions }
it { should respond_to(:supported_versions) }
it { should have_at_least(1).supported_versions }