[PATCH conductor] fix conductor spec suite on ruby 1.9

Jason Guiditta jguiditt at redhat.com
Tue Feb 28 15:49:37 UTC 2012


On 23/02/12 16:20 -0500, Mo Morsi wrote:
>  spec suite now fully runs successfully
>

Are all patches pushed that this depends on?  If not, which are
needed?  Maybe I can try an get the pre-reqs tested today if they have
not yet been reviewed.

>---
> src/app/controllers/application_controller.rb      |    2 +-
> src/app/controllers/deployables_controller.rb      |    2 +-
> .../controllers/permissions_controller_spec.rb     |    2 +-
> src/spec/controllers/pools_controller_spec.rb      |    5 ++++-
> 4 files changed, 7 insertions(+), 4 deletions(-)
>
>diff --git a/src/app/controllers/application_controller.rb b/src/app/controllers/application_controller.rb
>index be2ded3..aa80e44 100644
>--- a/src/app/controllers/application_controller.rb
>+++ b/src/app/controllers/application_controller.rb
>@@ -112,7 +112,7 @@ class ApplicationController < ActionController::Base
>   end
>
>   # Returns an array of ids from params[:id], params[:ids].
>-  def ids_list(other_attrs=[])
>+  def ids_list(*other_attrs)
Does ruby 1.9 really not support setting a default of an empty array
in the method definition?  If so, this sounds kind of like a loss of
functionality in the language.

>     other_attrs.each do |attr_key|
>       return params[attr_key].to_a if params.include?(attr_key)
>     end
>diff --git a/src/app/controllers/deployables_controller.rb b/src/app/controllers/deployables_controller.rb
>index e37bc4a..cd66133 100644
>--- a/src/app/controllers/deployables_controller.rb
>+++ b/src/app/controllers/deployables_controller.rb
>@@ -116,7 +116,7 @@ class DeployablesController < ApplicationController
>
>     require_privilege(Privilege::CREATE, Deployable)
>     @deployable = Deployable.new(params[:deployable])
>-    @selected_catalogs = Catalog.find(params[:catalog_id].to_a)
>+    @selected_catalogs = Catalog.find(Array(params[:catalog_id]))

Same comment here - you really have to explicitly pass in 'Array'' to
the find method?  Is so, this is a bug step back for ruby.

>     @deployable.owner = current_user
>
>     if params.has_key? :url
>diff --git a/src/spec/controllers/permissions_controller_spec.rb b/src/spec/controllers/permissions_controller_spec.rb
>index 8c4741b..7cedb29 100644
>--- a/src/spec/controllers/permissions_controller_spec.rb
>+++ b/src/spec/controllers/permissions_controller_spec.rb
>@@ -35,7 +35,7 @@ describe PermissionsController do
>     @permission = FactoryGirl.create(:permission, :user => @admin, :role => @old_role, :permission_object => @deployable)
>
>     post :multi_update, :permission_object_id => @deployable.id, :permission_object_type => @deployable.class.to_s,
>-        :permission_role_selected => "#{@permission.id},#{@new_role.id}", :polymorphic_path_extras => { 'catalog_id' => @catalog.id}
>+        :permission_role_selected => ["#{@permission.id},#{@new_role.id}"], :polymorphic_path_extras => { 'catalog_id' => @catalog.id}
>
>     response.should redirect_to catalog_deployable_path(@catalog, @deployable)
>   end
>diff --git a/src/spec/controllers/pools_controller_spec.rb b/src/spec/controllers/pools_controller_spec.rb
>index 21af9d0..ba68755 100644
>--- a/src/spec/controllers/pools_controller_spec.rb
>+++ b/src/spec/controllers/pools_controller_spec.rb
>@@ -119,7 +119,10 @@ describe PoolsController do
>     describe "#destroy" do
>       before do
>         @pool = Factory.build(:pool)
>-        Pool.stub!(:find).and_return([@pool])
>+        @tpool = Factory.build(:tpool)
>+        @pool.save!
>+        @tpool.save!
>+        Pool.stub!(:find).and_return([@pool], @tpool)
>         delete :multi_destroy, :pools_selected => [@pool.id], :format => :json
>       end
>
>-- 
>1.7.6.5
>



More information about the aeolus-devel mailing list