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

more test passing

This commit is contained in:
nightshade427 2011-03-22 10:02:47 -04:00 committed by Nicholas Ricketts
parent 2aa4b325af
commit 0ddeb8bb06
3 changed files with 10 additions and 3 deletions

View file

@ -8,7 +8,7 @@ module Fog
:method => 'GET', :method => 'GET',
:query => { :api_action => 'avail.stackscripts' }.merge!(options) :query => { :api_action => 'avail.stackscripts' }.merge!(options)
) )
result.body['DATA']['DISTRIBUTIONIDLIST'] = result.body['DATA']['DISTRIBUTIONIDLIST'].to_s result.body['DATA'].each { |r| r['DISTRIBUTIONIDLIST'] = r['DISTRIBUTIONIDLIST'].to_s }
result result
end end
end end

View file

@ -7,11 +7,13 @@ module Fog
if script_id if script_id
options.merge!(:stackScriptID => script_id) options.merge!(:stackScriptID => script_id)
end end
request( result = request(
:expects => 200, :expects => 200,
:method => 'GET', :method => 'GET',
:query => { :api_action => 'stackscript.list' }.merge!(options) :query => { :api_action => 'stackscript.list' }.merge!(options)
) )
result.body['DATA'].each { |r| r['DISTRIBUTIONIDLIST'] = r['DISTRIBUTIONIDLIST'].to_s }
result
end end
end end
end end

View file

@ -5,7 +5,7 @@ Shindo.tests('Linode::Compute | stack_script requests', ['linode']) do
'STACKSCRIPTID' => Integer, 'STACKSCRIPTID' => Integer,
'SCRIPT' => String, 'SCRIPT' => String,
'DESCRIPTION' => String, 'DESCRIPTION' => String,
'DISTRIBUTIONIDLIST' => Integer, 'DISTRIBUTIONIDLIST' => String,
'LABEL' => String, 'LABEL' => String,
'DEPLOYMENTSTOTAL' => Integer, 'DEPLOYMENTSTOTAL' => Integer,
'LATESTREV' => Integer, 'LATESTREV' => Integer,
@ -20,6 +20,11 @@ Shindo.tests('Linode::Compute | stack_script requests', ['linode']) do
tests('success') do tests('success') do
tests('#avail_stackscripts').formats(@stack_scripts_format) do
pending if Fog.mocking?
Linode[:compute].avail_stackscripts.body
end
tests('#stackscript_list').formats(@stack_scripts_format) do tests('#stackscript_list').formats(@stack_scripts_format) do
pending if Fog.mocking? pending if Fog.mocking?
Linode[:compute].stackscript_list.body Linode[:compute].stackscript_list.body