From 0ddeb8bb0668ab7fabd245b1295187946fd4eae6 Mon Sep 17 00:00:00 2001 From: nightshade427 Date: Tue, 22 Mar 2011 10:02:47 -0400 Subject: [PATCH] more test passing --- lib/fog/compute/requests/linode/avail_stackscripts.rb | 2 +- lib/fog/compute/requests/linode/stackscript_list.rb | 4 +++- tests/compute/requests/linode/stackscripts_tests.rb | 7 ++++++- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/lib/fog/compute/requests/linode/avail_stackscripts.rb b/lib/fog/compute/requests/linode/avail_stackscripts.rb index 47a7b0a34..34e5dcb81 100644 --- a/lib/fog/compute/requests/linode/avail_stackscripts.rb +++ b/lib/fog/compute/requests/linode/avail_stackscripts.rb @@ -8,7 +8,7 @@ module Fog :method => 'GET', :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 end end diff --git a/lib/fog/compute/requests/linode/stackscript_list.rb b/lib/fog/compute/requests/linode/stackscript_list.rb index 4ca1b17b4..452e53580 100644 --- a/lib/fog/compute/requests/linode/stackscript_list.rb +++ b/lib/fog/compute/requests/linode/stackscript_list.rb @@ -7,11 +7,13 @@ module Fog if script_id options.merge!(:stackScriptID => script_id) end - request( + result = request( :expects => 200, :method => 'GET', :query => { :api_action => 'stackscript.list' }.merge!(options) ) + result.body['DATA'].each { |r| r['DISTRIBUTIONIDLIST'] = r['DISTRIBUTIONIDLIST'].to_s } + result end end end diff --git a/tests/compute/requests/linode/stackscripts_tests.rb b/tests/compute/requests/linode/stackscripts_tests.rb index 547f75dc2..07862e4bc 100644 --- a/tests/compute/requests/linode/stackscripts_tests.rb +++ b/tests/compute/requests/linode/stackscripts_tests.rb @@ -5,7 +5,7 @@ Shindo.tests('Linode::Compute | stack_script requests', ['linode']) do 'STACKSCRIPTID' => Integer, 'SCRIPT' => String, 'DESCRIPTION' => String, - 'DISTRIBUTIONIDLIST' => Integer, + 'DISTRIBUTIONIDLIST' => String, 'LABEL' => String, 'DEPLOYMENTSTOTAL' => Integer, 'LATESTREV' => Integer, @@ -20,6 +20,11 @@ Shindo.tests('Linode::Compute | stack_script requests', ['linode']) 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 pending if Fog.mocking? Linode[:compute].stackscript_list.body