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

Fix the signature of the Linode avail_stackscripts mock.

Make the avail_stackscripts mock signature match the real method
(options instead of an id).
This commit is contained in:
Phil Ross 2015-10-24 23:47:58 +01:00
parent 2d71a749fd
commit 491ad474d9

View file

@ -14,7 +14,7 @@ module Fog
end
class Mock
def avail_stackscripts(stackscript_id=nil)
def avail_stackscripts(options={})
response = Excon::Response.new
response.status = 200
@ -22,17 +22,12 @@ module Fog
"ERRORARRAY" => [],
"ACTION" => "avail.stackscripts"
}
if stackscript_id
mock_stackscript = create_mock_stackscript(stackscript_id)
response.body = body.merge("DATA" => [mock_stackscript])
else
mock_stackscripts = []
10.times do
stackscript_id = rand(1..200)
mock_stackscripts << create_mock_stackscript(stackscript_id)
end
response.body = body.merge("DATA" => mock_stackscripts)
mock_stackscripts = []
10.times do
stackscript_id = rand(1..200)
mock_stackscripts << create_mock_stackscript(stackscript_id)
end
response.body = body.merge("DATA" => mock_stackscripts)
response
end