1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00
fog--fog/tests/rackspace/models/compute_v2/servers_tests.rb
Paul Thornthwaite b7b7f51b0b [rackspace] Fixes nesting of tests
Fog::Compute connection was called outside of the Shindo blocks and
failing if rackspace credentials were not present.
2013-01-17 10:33:17 +00:00

24 lines
674 B
Ruby

Shindo.tests('Fog::Compute::RackspaceV2 | servers', ['rackspace']) do
connection = Fog::Compute::RackspaceV2.new
flavor_id = Fog.credentials[:rackspace_flavor_id] || connection.flavors.first.id
image_id = Fog.credentials[:rackspace_image_id] || connection.images.first.id
options = {
:name => "fog_server_#{Time.now.to_i.to_s}",
:flavor_id => flavor_id,
:image_id => image_id
}
collection_tests(connection.servers, options, true) do
@instance.wait_for { ready? }
end
tests("#bootstrap").succeeds do
pending if Fog.mocking?
@server = connection.servers.bootstrap(options)
end
if @server
@server.destroy
end
end