Cleanups + Fixes #get_machine test breaking when there are no machines

This commit is contained in:
Kevin Chan 2012-02-22 17:37:55 -08:00 committed by geemus
parent 4ff115c1de
commit c0bc793ccb
2 changed files with 7 additions and 4 deletions

View File

@ -1,4 +1,4 @@
Shindo.tests("Fog::Compute::Joyent | key requests", ['joyent']) do
Shindo.tests("Fog::Compute[:joyent] | key requests", ['joyent']) do
@key_format = {
"name" => String,

View File

@ -56,9 +56,12 @@ Shindo.tests("Fog::Compute[:joyent] | machine requests", ["joyent"]) do
# https://us-west-1.api.joyentcloud.com/docs#GetMachine
tests("#get_machine") do
formats(@machine_format) do
id = @provider.list_machines.body.first["id"]
@provider.get_machine(id).body
machines = @provider.list_machines.body
unless machines.empty?
formats(@machine_format) do
id = machines.first["id"]
@provider.get_machine(id).body
end
end
end
end