From a76ea8252e3e4a94f3d116bf0b26d1581da1cbee Mon Sep 17 00:00:00 2001 From: Christo De Lange Date: Sun, 25 Dec 2016 15:06:22 -0500 Subject: [PATCH] More RuboCop cleanup not directly related to the PR --- lib/kitchen/driver/gce.rb | 4 ++-- spec/kitchen/driver/gce_spec.rb | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/kitchen/driver/gce.rb b/lib/kitchen/driver/gce.rb index 45b2ac7..aedb227 100644 --- a/lib/kitchen/driver/gce.rb +++ b/lib/kitchen/driver/gce.rb @@ -200,7 +200,7 @@ def authorization end def winrm_transport? - instance.transport.name.downcase == "winrm" + instance.transport.name.casecmp("winrm").zero? end def update_windows_password(server_name) @@ -416,7 +416,7 @@ def image_alias_url latest_image = connection.list_images(image_project).items .select { |image| image.name.start_with?(image_prefix) } - .sort { |a, b| a.name <=> b.name } + .sort_by(&:name) .last return if latest_image.nil? diff --git a/spec/kitchen/driver/gce_spec.rb b/spec/kitchen/driver/gce_spec.rb index ae4caf3..660b689 100644 --- a/spec/kitchen/driver/gce_spec.rb +++ b/spec/kitchen/driver/gce_spec.rb @@ -381,7 +381,7 @@ end it "raises an exception if the block raises something other than a ClientError" do - expect { driver.check_api_call { raise RuntimeError.new("whoops") } }.to raise_error(RuntimeError) + expect { driver.check_api_call { raise "whoops" } }.to raise_error(RuntimeError) end it "returns true if the block does not raise an exception" do @@ -832,7 +832,7 @@ it "accepts custom metadata" do foo = double("foo") - config[:metadata] = { 'foo' => 'bar' } + config[:metadata] = { "foo" => "bar" } expect(instance).to receive(:name).and_return("instance_name") expect(driver).to receive(:env_user).and_return("env_user")