From 4007bc7ee3d89e11eab6b4974bbd8a07bccadccd Mon Sep 17 00:00:00 2001 From: nwalter Date: Tue, 30 Jun 2015 13:50:52 +0200 Subject: [PATCH] fix rubocop offenses --- lib/suse/connect/product.rb | 4 +++- lib/suse/connect/yast.rb | 2 +- spec/connect/product_spec.rb | 16 ++++++++-------- spec/connect/yast_spec.rb | 2 +- 4 files changed, 13 insertions(+), 11 deletions(-) diff --git a/lib/suse/connect/product.rb b/lib/suse/connect/product.rb index 56eae50e..4cc2aec0 100644 --- a/lib/suse/connect/product.rb +++ b/lib/suse/connect/product.rb @@ -1,5 +1,7 @@ module SUSE module Connect + + # Product class is a common class to represent all products class Product < OpenStruct def self.transform(old_product) @@ -12,4 +14,4 @@ def self.transform(old_product) end end end -end \ No newline at end of file +end diff --git a/lib/suse/connect/yast.rb b/lib/suse/connect/yast.rb index ab576758..0e8c6702 100644 --- a/lib/suse/connect/yast.rb +++ b/lib/suse/connect/yast.rb @@ -106,7 +106,7 @@ def all_products(client_params = {}) installed_products = status.installed_products activated_products = status.activated_products products = installed_products + activated_products - products.map { |product| Product.transform(product) } + products.map {|product| Product.transform(product) } end def add_service(service_url, service_name) diff --git a/spec/connect/product_spec.rb b/spec/connect/product_spec.rb index d5610d80..afad4ada 100644 --- a/spec/connect/product_spec.rb +++ b/spec/connect/product_spec.rb @@ -7,20 +7,20 @@ zypperprod = Zypper::Product.new(:name => 'SLES', :version => '12', :arch => 'x86_64') connectprod = described_class.transform(zypperprod) expect(connectprod).to be_kind_of(described_class) - expect(connectprod.identifier).to eq (zypperprod.identifier) - expect(connectprod.version).to eq (zypperprod.version) - expect(connectprod.arch).to eq (zypperprod.arch) - expect(connectprod.release_type).to eq (zypperprod.release_type) + expect(connectprod.identifier).to eq(zypperprod.identifier) + expect(connectprod.version).to eq(zypperprod.version) + expect(connectprod.arch).to eq(zypperprod.arch) + expect(connectprod.release_type).to eq(zypperprod.release_type) end it 'returns Product Class from Remote products' do remoteprod = Remote::Product.new(:identifier => 'SLES', :version => '12', :arch => 'x86_64', :release_type => 'HP-CNB') connectprod = described_class.transform(remoteprod) expect(connectprod).to be_kind_of(described_class) - expect(connectprod.identifier).to eq (remoteprod.identifier) - expect(connectprod.version).to eq (remoteprod.version) - expect(connectprod.arch).to eq (remoteprod.arch) - expect(connectprod.release_type).to eq (remoteprod.release_type) + expect(connectprod.identifier).to eq(remoteprod.identifier) + expect(connectprod.version).to eq(remoteprod.version) + expect(connectprod.arch).to eq(remoteprod.arch) + expect(connectprod.release_type).to eq(remoteprod.release_type) end end diff --git a/spec/connect/yast_spec.rb b/spec/connect/yast_spec.rb index a0f7821d..b89f6bd3 100644 --- a/spec/connect/yast_spec.rb +++ b/spec/connect/yast_spec.rb @@ -220,7 +220,7 @@ expect_any_instance_of(Status).to receive(:activated_products).and_return([remote_product]) result = SUSE::Connect::YaST.all_products - expect(result).to match_array([ Product.transform(zypper_product), Product.transform(remote_product) ]) + expect(result).to match_array([Product.transform(zypper_product), Product.transform(remote_product)]) end end