From 2fe34758bba4a6ea5a836cb14d752148864489d3 Mon Sep 17 00:00:00 2001 From: Imran Iqbal Date: Tue, 8 Oct 2019 00:26:29 +0100 Subject: [PATCH] fix(rubocop): add fixes using `rubocop --safe-auto-correct` --- Gemfile | 7 ++++--- bin/kitchen | 14 +++++++------- test/integration/default/controls/config_spec.rb | 2 ++ test/integration/default/controls/packages_spec.rb | 6 +++--- test/integration/default/controls/services_spec.rb | 6 +++--- .../default/controls/subcomponent_config_spec.rb | 2 ++ 6 files changed, 21 insertions(+), 16 deletions(-) diff --git a/Gemfile b/Gemfile index 3b36de32..5a232b61 100644 --- a/Gemfile +++ b/Gemfile @@ -1,6 +1,7 @@ -source "https://rubygems.org" +# frozen_string_literal: true + +source 'https://rubygems.org' gem 'kitchen-docker', '>= 2.9' -gem 'kitchen-salt', '>= 0.6.0' gem 'kitchen-inspec', '>= 1.1' - +gem 'kitchen-salt', '>= 0.6.0' diff --git a/bin/kitchen b/bin/kitchen index 1cd44f3a..621b13ac 100755 --- a/bin/kitchen +++ b/bin/kitchen @@ -8,11 +8,11 @@ # this file is here to facilitate running it. # -require "pathname" -ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", - Pathname.new(__FILE__).realpath) +require 'pathname' +ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', + Pathname.new(__FILE__).realpath) -bundle_binstub = File.expand_path("../bundle", __FILE__) +bundle_binstub = File.expand_path('bundle', __dir__) if File.file?(bundle_binstub) if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/ @@ -23,7 +23,7 @@ Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this end end -require "rubygems" -require "bundler/setup" +require 'rubygems' +require 'bundler/setup' -load Gem.bin_path("test-kitchen", "kitchen") +load Gem.bin_path('test-kitchen', 'kitchen') diff --git a/test/integration/default/controls/config_spec.rb b/test/integration/default/controls/config_spec.rb index 9c8a8ebb..2abbc708 100644 --- a/test/integration/default/controls/config_spec.rb +++ b/test/integration/default/controls/config_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + control 'template configuration' do title 'should match desired lines' diff --git a/test/integration/default/controls/packages_spec.rb b/test/integration/default/controls/packages_spec.rb index 1155548e..4daa41b5 100644 --- a/test/integration/default/controls/packages_spec.rb +++ b/test/integration/default/controls/packages_spec.rb @@ -1,8 +1,8 @@ +# frozen_string_literal: true + # Overide by OS package_name = 'bash' -if os[:name] == 'centos' and os[:release].start_with?('6') - package_name = 'cronie' -end +package_name = 'cronie' if (os[:name] == 'centos') && os[:release].start_with?('6') control 'template package' do title 'should be installed' diff --git a/test/integration/default/controls/services_spec.rb b/test/integration/default/controls/services_spec.rb index 960e7047..c00f75f0 100644 --- a/test/integration/default/controls/services_spec.rb +++ b/test/integration/default/controls/services_spec.rb @@ -1,8 +1,8 @@ +# frozen_string_literal: true + # Overide by OS service_name = 'systemd-udevd' -if os[:name] == 'centos' and os[:release].start_with?('6') - service_name = 'crond' -end +service_name = 'crond' if (os[:name] == 'centos') && os[:release].start_with?('6') control 'template service' do impact 0.5 diff --git a/test/integration/default/controls/subcomponent_config_spec.rb b/test/integration/default/controls/subcomponent_config_spec.rb index 8f3a5cfa..fff76870 100644 --- a/test/integration/default/controls/subcomponent_config_spec.rb +++ b/test/integration/default/controls/subcomponent_config_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + control 'template subcomponent configuration' do title 'should match desired lines'