From e5e35b1d053164bf2cd054a132537091a4296d0e Mon Sep 17 00:00:00 2001 From: Ladislav Smola <lsmola@redhat.com> Date: Fri, 10 Mar 2017 15:24:48 +0100 Subject: [PATCH] Autofix rubocop issues Autofix rubocop issues --- .../manager_refresh/target_collection.rb | 2 +- .../manager_refresh/target_collection_spec.rb | 42 +++++++--------- spec/models/manager_refresh/target_spec.rb | 48 ++++++++----------- 3 files changed, 39 insertions(+), 53 deletions(-) diff --git a/app/models/manager_refresh/target_collection.rb b/app/models/manager_refresh/target_collection.rb index 746f015b266..ef077942d4d 100644 --- a/app/models/manager_refresh/target_collection.rb +++ b/app/models/manager_refresh/target_collection.rb @@ -59,7 +59,7 @@ def id def manager_refs_by_association @manager_refs_by_association ||= targets.select { |x| x.kind_of?(ManagerRefresh::Target) }.each_with_object({}) do |x, obj| if obj[x.association].blank? - obj[x.association] = x.manager_ref.each_with_object({}) { |(key, value), hash| hash[key] = Set.new([value])} + obj[x.association] = x.manager_ref.each_with_object({}) { |(key, value), hash| hash[key] = Set.new([value]) } else obj[x.association].each do |key, value| value << x.manager_ref[key] diff --git a/spec/models/manager_refresh/target_collection_spec.rb b/spec/models/manager_refresh/target_collection_spec.rb index a361958ecf1..c1d002e6a2f 100644 --- a/spec/models/manager_refresh/target_collection_spec.rb +++ b/spec/models/manager_refresh/target_collection_spec.rb @@ -29,14 +29,12 @@ expect(target_collection.targets.first).to( have_attributes( - { - :manager => @ems, - :manager_id => @ems.id, - :event_id => nil, - :association => :vms, - :manager_ref => {:ems_ref => @vm_1.ems_ref}, - :options => {:opt1 => "opt1", :opt2 => "opt2"} - } + :manager => @ems, + :manager_id => @ems.id, + :event_id => nil, + :association => :vms, + :manager_ref => {:ems_ref => @vm_1.ems_ref}, + :options => {:opt1 => "opt1", :opt2 => "opt2"} ) ) end @@ -52,14 +50,12 @@ expect(target_collection.targets.first).to( have_attributes( - { - :manager => @ems, - :manager_id => @ems.id, - :event_id => @ems_event.id, - :association => :vms, - :manager_ref => {:ems_ref => @vm_1.ems_ref}, - :options => {:opt1 => "opt1", :opt2 => "opt2"} - } + :manager => @ems, + :manager_id => @ems.id, + :event_id => @ems_event.id, + :association => :vms, + :manager_ref => {:ems_ref => @vm_1.ems_ref}, + :options => {:opt1 => "opt1", :opt2 => "opt2"} ) ) end @@ -75,14 +71,12 @@ expect(target_collection.targets.first).to( have_attributes( - { - :manager => @ems, - :manager_id => @ems.id, - :event_id => @ems_event.id, - :association => :vms, - :manager_ref => {:ems_ref => @vm_1.ems_ref}, - :options => {:opt1 => "opt1", :opt2 => "opt2"} - } + :manager => @ems, + :manager_id => @ems.id, + :event_id => @ems_event.id, + :association => :vms, + :manager_ref => {:ems_ref => @vm_1.ems_ref}, + :options => {:opt1 => "opt1", :opt2 => "opt2"} ) ) end diff --git a/spec/models/manager_refresh/target_spec.rb b/spec/models/manager_refresh/target_spec.rb index fca4c898937..af9a9311154 100644 --- a/spec/models/manager_refresh/target_spec.rb +++ b/spec/models/manager_refresh/target_spec.rb @@ -27,13 +27,11 @@ expect(target_1).to( have_attributes( - { - :manager => @ems, - :manager_id => @ems.id, - :association => :vms, - :manager_ref => {:ems_ref => @vm_1.ems_ref}, - :options => {:opt1 => "opt1", :opt2 => "opt2"} - } + :manager => @ems, + :manager_id => @ems.id, + :association => :vms, + :manager_ref => {:ems_ref => @vm_1.ems_ref}, + :options => {:opt1 => "opt1", :opt2 => "opt2"} ) ) end @@ -48,13 +46,11 @@ expect(target_1).to( have_attributes( - { - :manager => @ems, - :manager_id => @ems.id, - :association => :vms, - :manager_ref => {:ems_ref => @vm_1.ems_ref}, - :options => {:opt1 => "opt1", :opt2 => "opt2"} - } + :manager => @ems, + :manager_id => @ems.id, + :association => :vms, + :manager_ref => {:ems_ref => @vm_1.ems_ref}, + :options => {:opt1 => "opt1", :opt2 => "opt2"} ) ) end @@ -80,13 +76,11 @@ expect(target_1.dump).to( eq( - { - :manager_id => @ems.id, - :event_id => nil, - :association => :vms, - :manager_ref => {:ems_ref => @vm_1.ems_ref}, - :options => {:opt1 => "opt1", :opt2 => "opt2"} - } + :manager_id => @ems.id, + :event_id => nil, + :association => :vms, + :manager_ref => {:ems_ref => @vm_1.ems_ref}, + :options => {:opt1 => "opt1", :opt2 => "opt2"} ) ) end @@ -101,13 +95,11 @@ expect(target_1.dump).to( eq( - { - :manager_id => @ems.id, - :event_id => nil, - :association => :vms, - :manager_ref => {:ems_ref => @vm_1.ems_ref}, - :options => {:opt1 => "opt1", :opt2 => "opt2"} - } + :manager_id => @ems.id, + :event_id => nil, + :association => :vms, + :manager_ref => {:ems_ref => @vm_1.ems_ref}, + :options => {:opt1 => "opt1", :opt2 => "opt2"} ) ) end