Skip to content

Commit

Permalink
fix rubocop offenses
Browse files Browse the repository at this point in the history
  • Loading branch information
NadjaW committed Jun 30, 2015
1 parent 699752c commit 4007bc7
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 11 deletions.
4 changes: 3 additions & 1 deletion 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)
Expand All @@ -12,4 +14,4 @@ def self.transform(old_product)
end
end
end
end
end
2 changes: 1 addition & 1 deletion lib/suse/connect/yast.rb
Expand Up @@ -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)
Expand Down
16 changes: 8 additions & 8 deletions spec/connect/product_spec.rb
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion spec/connect/yast_spec.rb
Expand Up @@ -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

Expand Down

0 comments on commit 4007bc7

Please sign in to comment.