mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
Cleanups + Fixes #get_machine test breaking when there are no machines
This commit is contained in:
parent
4ff115c1de
commit
c0bc793ccb
2 changed files with 7 additions and 4 deletions
|
@ -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,
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue