diff options
102 files changed, 351 insertions, 351 deletions
diff --git a/lib/chef/chef_fs/data_handler/data_bag_item_data_handler.rb b/lib/chef/chef_fs/data_handler/data_bag_item_data_handler.rb index d56f662c5c..260666b65f 100644 --- a/lib/chef/chef_fs/data_handler/data_bag_item_data_handler.rb +++ b/lib/chef/chef_fs/data_handler/data_bag_item_data_handler.rb @@ -13,7 +13,7 @@ class Chef # chef_type and data_bag come back in PUT and POST results, but we don't # use those in knife-essentials. normalize_hash(data_bag_item, { - "id" => remove_dot_json(entry.name) + "id" => remove_dot_json(entry.name), },) end diff --git a/lib/chef/environment.rb b/lib/chef/environment.rb index 9cdb8a8522..cd3bbd96ff 100644 --- a/lib/chef/environment.rb +++ b/lib/chef/environment.rb @@ -59,7 +59,7 @@ class Chef set_or_return( :name, arg, - { :regex => /^[\-[:alnum:]_]+$/, :kind_of => String } + { :regex => /^[\-[:alnum:]_]+$/, :kind_of => String }, ) end @@ -102,7 +102,7 @@ class Chef { :kind_of => Hash, :callbacks => { - "should be a valid set of cookbook version requirements" => lambda { |cv| Chef::Environment.validate_cookbook_versions(cv) } + "should be a valid set of cookbook version requirements" => lambda { |cv| Chef::Environment.validate_cookbook_versions(cv) }, }, }, ) @@ -110,11 +110,11 @@ class Chef def cookbook(cookbook, version) validate({ - :version => version + :version => version, }, { :version => { - :callbacks => { "should be a valid version requirement" => lambda { |v| Chef::Environment.validate_cookbook_version(v) } } - } + :callbacks => { "should be a valid version requirement" => lambda { |v| Chef::Environment.validate_cookbook_version(v) } }, + }, },) @cookbook_versions[cookbook] = version end diff --git a/lib/chef/file_cache.rb b/lib/chef/file_cache.rb index cb8bf9bd11..b4f3de236a 100644 --- a/lib/chef/file_cache.rb +++ b/lib/chef/file_cache.rb @@ -105,10 +105,10 @@ class Chef def load(path, read = true) validate( { - :path => path + :path => path, }, { - :path => { :kind_of => String } + :path => { :kind_of => String }, }, ) cache_path = create_cache_path(path, false) @@ -131,10 +131,10 @@ class Chef def delete(path) validate( { - :path => path + :path => path, }, { - :path => { :kind_of => String } + :path => { :kind_of => String }, }, ) cache_path = create_cache_path(path, false) @@ -178,10 +178,10 @@ class Chef def has_key?(path) validate( { - :path => path + :path => path, }, { - :path => { :kind_of => String } + :path => { :kind_of => String }, }, ) full_path = create_cache_path(path, false) diff --git a/lib/chef/key.rb b/lib/chef/key.rb index ef29bd7288..1c25c5daad 100644 --- a/lib/chef/key.rb +++ b/lib/chef/key.rb @@ -117,7 +117,7 @@ class Chef def to_hash result = { - @actor_field_name => @actor + @actor_field_name => @actor, } result["name"] = @name if @name result["public_key"] = @public_key if @public_key diff --git a/lib/chef/knife/data_bag_create.rb b/lib/chef/knife/data_bag_create.rb index 196278bb80..3576ec7379 100644 --- a/lib/chef/knife/data_bag_create.rb +++ b/lib/chef/knife/data_bag_create.rb @@ -66,7 +66,7 @@ class Chef Chef::EncryptedDataBagItem.encrypt_data_bag_item(output, read_secret) else output - end + end, ) item.data_bag(@data_bag_name) rest.post("data/#{@data_bag_name}", item) diff --git a/lib/chef/mixin/securable.rb b/lib/chef/mixin/securable.rb index af3e10126b..9cde53d66f 100644 --- a/lib/chef/mixin/securable.rb +++ b/lib/chef/mixin/securable.rb @@ -54,7 +54,7 @@ class Chef else Integer(m) <= 07777 && Integer(m) >= 0 end - } + }, }, ) end diff --git a/lib/chef/mixin/windows_env_helper.rb b/lib/chef/mixin/windows_env_helper.rb index 65b4b33cf0..47f1aeb865 100644 --- a/lib/chef/mixin/windows_env_helper.rb +++ b/lib/chef/mixin/windows_env_helper.rb @@ -47,7 +47,7 @@ class Chef Chef::ReservedNames::Win32::Error.raise! end if SendMessageTimeoutW(HWND_BROADCAST, WM_SETTINGCHANGE, 0, FFI::MemoryPointer.from_string( - utf8_to_wide("Environment") + utf8_to_wide("Environment"), ).address, flags, 5000, nil) == 0 Chef::ReservedNames::Win32::Error.raise! end diff --git a/lib/chef/monologger.rb b/lib/chef/monologger.rb index 49f744e314..a1dd594c7a 100644 --- a/lib/chef/monologger.rb +++ b/lib/chef/monologger.rb @@ -79,7 +79,7 @@ class MonoLogger < Logger def add_log_header(file) file.write( - "# Logfile created on %s by %s\n" % [Time.now.to_s, Logger::ProgName] + "# Logfile created on %s by %s\n" % [Time.now.to_s, Logger::ProgName], ) end diff --git a/lib/chef/node.rb b/lib/chef/node.rb index 0471fe1171..c7813eb2aa 100644 --- a/lib/chef/node.rb +++ b/lib/chef/node.rb @@ -114,7 +114,7 @@ class Chef { :name => arg }, { :name => { :kind_of => String, :cannot_be => :blank, - :regex => /^[\-[:alnum:]_:.]+$/ } + :regex => /^[\-[:alnum:]_:.]+$/ }, },) @name = arg else @@ -126,7 +126,7 @@ class Chef set_or_return( :chef_environment, arg, - { :regex => /^[\-[:alnum:]_]+$/, :kind_of => String } + { :regex => /^[\-[:alnum:]_]+$/, :kind_of => String }, ) end diff --git a/lib/chef/platform/provider_mapping.rb b/lib/chef/platform/provider_mapping.rb index d24cd8c18c..1a5da902ef 100644 --- a/lib/chef/platform/provider_mapping.rb +++ b/lib/chef/platform/provider_mapping.rb @@ -119,10 +119,10 @@ class Chef :required => false, }, :resource => { - :kind_of => Symbol + :kind_of => Symbol, }, :provider => { - :kind_of => [ String, Symbol, Class ] + :kind_of => [ String, Symbol, Class ], }, }, ) @@ -133,14 +133,14 @@ class Chef platforms[args[:platform]][args[:version]][args[:resource].to_sym] = args[:provider] else platforms[args[:platform]][args[:version]] = { - args[:resource].to_sym => args[:provider] + args[:resource].to_sym => args[:provider], } end else platforms[args[:platform]] = { args[:version] => { - args[:resource].to_sym => args[:provider] - } + args[:resource].to_sym => args[:provider], + }, } end else @@ -155,8 +155,8 @@ class Chef else platforms[args[:platform]] = { :default => { - args[:resource].to_sym => args[:provider] - } + args[:resource].to_sym => args[:provider], + }, } end end @@ -165,7 +165,7 @@ class Chef platforms[:default][args[:resource].to_sym] = args[:provider] else platforms[:default] = { - args[:resource].to_sym => args[:provider] + args[:resource].to_sym => args[:provider], } end end diff --git a/lib/chef/platform/service_helpers.rb b/lib/chef/platform/service_helpers.rb index 87b87d4c72..28c4c5ec59 100644 --- a/lib/chef/platform/service_helpers.rb +++ b/lib/chef/platform/service_helpers.rb @@ -105,7 +105,7 @@ class Chef def has_systemd_service_unit?(svc_name) %w{ /etc /usr/lib /lib /run }.any? do |load_path| ::File.exist?( - Chef.path_to("#{load_path}/systemd/system/#{svc_name.gsub(/@.*$/, '@')}.service") + Chef.path_to("#{load_path}/systemd/system/#{svc_name.gsub(/@.*$/, '@')}.service"), ) end end diff --git a/lib/chef/policy_builder/expand_node_object.rb b/lib/chef/policy_builder/expand_node_object.rb index b69ecfe6a8..6a006ec992 100644 --- a/lib/chef/policy_builder/expand_node_object.rb +++ b/lib/chef/policy_builder/expand_node_object.rb @@ -237,7 +237,7 @@ class Chef def setup_run_list_override runlist_override_sanity_check! - unless(override_runlist.empty?) + unless override_runlist.empty? node.override_runlist(*override_runlist) Chef::Log.warn "Run List override has been provided." Chef::Log.warn "Original Run List: [#{node.primary_runlist}]" @@ -253,7 +253,7 @@ class Chef end @override_runlist = [override_runlist].flatten.compact override_runlist.map! do |item| - if(item.is_a?(Chef::RunList::RunListItem)) + if item.is_a?(Chef::RunList::RunListItem) item else Chef::RunList::RunListItem.new(item) diff --git a/lib/chef/provider/execute.rb b/lib/chef/provider/execute.rb index 45f0ad5488..4e7d8e1454 100644 --- a/lib/chef/provider/execute.rb +++ b/lib/chef/provider/execute.rb @@ -117,7 +117,7 @@ class Chef def sentinel_file Pathname.new(Chef::Util::PathHelper.cleanpath( - ( cwd && creates_relative? ) ? ::File.join(cwd, creates) : creates + ( cwd && creates_relative? ) ? ::File.join(cwd, creates) : creates, )) end end diff --git a/lib/chef/provider/group.rb b/lib/chef/provider/group.rb index efcbef8014..fcae24f8f9 100644 --- a/lib/chef/provider/group.rb +++ b/lib/chef/provider/group.rb @@ -90,7 +90,7 @@ class Chef @change_desc << "change gid #{@current_resource.gid} to #{@new_resource.gid}" end - if(@new_resource.append) + if @new_resource.append missing_members = [] @new_resource.members.each do |member| next if has_current_group_member?(member) diff --git a/lib/chef/provider/group/dscl.rb b/lib/chef/provider/group/dscl.rb index 08661f21b8..00b4ce2b93 100644 --- a/lib/chef/provider/group/dscl.rb +++ b/lib/chef/provider/group/dscl.rb @@ -72,7 +72,7 @@ class Chef def get_free_gid(search_limit = 1000) gid = nil; next_gid_guess = 200 groups_gids = safe_dscl("list /Groups gid") - while(next_gid_guess < search_limit + 200) + while next_gid_guess < search_limit + 200 if groups_gids =~ Regexp.new("#{Regexp.escape(next_gid_guess.to_s)}\n") next_gid_guess += 1 else diff --git a/lib/chef/provider/launchd.rb b/lib/chef/provider/launchd.rb index 41c61eafde..c58d4bfa34 100644 --- a/lib/chef/provider/launchd.rb +++ b/lib/chef/provider/launchd.rb @@ -40,7 +40,7 @@ class Chef :path, :source, :session_type, - :type + :type, ] def load_current_resource @@ -51,7 +51,7 @@ class Chef def gen_path_from_type types = { "daemon" => "/Library/LaunchDaemons/#{label}.plist", - "agent" => "/Library/LaunchAgents/#{label}.plist" + "agent" => "/Library/LaunchAgents/#{label}.plist", } types[type] end diff --git a/lib/chef/provider/link.rb b/lib/chef/provider/link.rb index d184094bbb..85c46ada98 100644 --- a/lib/chef/provider/link.rb +++ b/lib/chef/provider/link.rb @@ -52,7 +52,7 @@ class Chef if file_class.symlink?(@current_resource.target_file) @current_resource.link_type(:symbolic) @current_resource.to( - canonicalize(file_class.readlink(@current_resource.target_file)) + canonicalize(file_class.readlink(@current_resource.target_file)), ) else @current_resource.link_type(:hard) diff --git a/lib/chef/provider/mount/mount.rb b/lib/chef/provider/mount/mount.rb index 635a4f6ea2..265911b54c 100644 --- a/lib/chef/provider/mount/mount.rb +++ b/lib/chef/provider/mount/mount.rb @@ -44,7 +44,7 @@ class Chef # only check for existence of non-remote devices if device_should_exist? && !::File.exists?(device_real) raise Chef::Exceptions::Mount, "Device #{@new_resource.device} does not exist" - elsif( @new_resource.mount_point != "none" && !::File.exists?(@new_resource.mount_point) ) + elsif @new_resource.mount_point != "none" && !::File.exists?(@new_resource.mount_point) raise Chef::Exceptions::Mount, "Mount point #{@new_resource.mount_point} does not exist" end return true diff --git a/lib/chef/provider/osx_profile.rb b/lib/chef/provider/osx_profile.rb index 3747a917fa..f232dede83 100644 --- a/lib/chef/provider/osx_profile.rb +++ b/lib/chef/provider/osx_profile.rb @@ -40,7 +40,7 @@ class Chef all_profiles = get_installed_profiles @new_resource.profile( @new_resource.profile || - @new_resource.profile_name + @new_resource.profile_name, ) @new_profile_hash = get_profile_hash(@new_resource.profile) @@ -141,7 +141,7 @@ class Chef def get_cache_dir cache_dir = Chef::FileCache.create_cache_path( - "profiles/#{@new_resource.cookbook_name}" + "profiles/#{@new_resource.cookbook_name}", ) end @@ -151,7 +151,7 @@ class Chef "profiles", @new_resource.cookbook_name, ::File.dirname(cookbook_file), - ) + ), ) remote_file = Chef::Resource::CookbookFile.new( ::File.join( diff --git a/lib/chef/provider/package/chocolatey.rb b/lib/chef/provider/package/chocolatey.rb index e111beb9b5..ad4db0c4e6 100644 --- a/lib/chef/provider/package/chocolatey.rb +++ b/lib/chef/provider/package/chocolatey.rb @@ -162,7 +162,7 @@ EOS # lets us mock out an incorrect value for testing. def choco_install_path @choco_install_path ||= powershell_out!( - PATHFINDING_POWERSHELL_COMMAND + PATHFINDING_POWERSHELL_COMMAND, ).stdout.chomp end diff --git a/lib/chef/provider/package/pacman.rb b/lib/chef/provider/package/pacman.rb index fe321037bd..bd8028d881 100644 --- a/lib/chef/provider/package/pacman.rb +++ b/lib/chef/provider/package/pacman.rb @@ -54,7 +54,7 @@ class Chef repos = %w{extra core community} - if(::File.exists?("/etc/pacman.conf")) + if ::File.exists?("/etc/pacman.conf") pacman = ::File.read("/etc/pacman.conf") repos = pacman.scan(/\[(.+)\]/).flatten end diff --git a/lib/chef/provider/package/paludis.rb b/lib/chef/provider/package/paludis.rb index e1b2ea1cf4..557e7ebc22 100644 --- a/lib/chef/provider/package/paludis.rb +++ b/lib/chef/provider/package/paludis.rb @@ -54,7 +54,7 @@ class Chef end def install_package(name, version) - if(version) + if version pkg = "=#{name}-#{version}" else pkg = "#{@new_resource.package_name}" @@ -67,7 +67,7 @@ class Chef end def remove_package(name, version) - if(version) + if version pkg = "=#{@new_resource.package_name}-#{version}" else pkg = "#{@new_resource.package_name}" diff --git a/lib/chef/provider/package/portage.rb b/lib/chef/provider/package/portage.rb index 688509889c..a514dcc66c 100644 --- a/lib/chef/provider/package/portage.rb +++ b/lib/chef/provider/package/portage.rb @@ -41,7 +41,7 @@ class Chef globsafe_pkg = Chef::Util::PathHelper.escape_glob(pkg) possibilities = Dir["/var/db/pkg/#{globsafe_category || "*"}/#{globsafe_pkg}-*"].map { |d| d.sub(%r{/var/db/pkg/}, "") } versions = possibilities.map do |entry| - if(entry =~ %r{[^/]+/#{Regexp.escape(pkg)}\-(\d[\.\d]*((_(alpha|beta|pre|rc|p)\d*)*)?(-r\d+)?)}) + if entry =~ %r{[^/]+/#{Regexp.escape(pkg)}\-(\d[\.\d]*((_(alpha|beta|pre|rc|p)\d*)*)?(-r\d+)?)} [$&, $1] end end.compact @@ -108,7 +108,7 @@ class Chef def install_package(name, version) pkg = "=#{name}-#{version}" - if(version =~ /^\~(.+)/) + if version =~ /^\~(.+)/ # If we start with a tilde pkg = "~#{name}-#{$1}" end @@ -121,7 +121,7 @@ class Chef end def remove_package(name, version) - if(version) + if version pkg = "=#{@new_resource.package_name}-#{version}" else pkg = "#{@new_resource.package_name}" diff --git a/lib/chef/provider/service/gentoo.rb b/lib/chef/provider/service/gentoo.rb index 66f2f10f23..1bfd46ef14 100644 --- a/lib/chef/provider/service/gentoo.rb +++ b/lib/chef/provider/service/gentoo.rb @@ -39,7 +39,7 @@ class Chef::Provider::Service::Gentoo < Chef::Provider::Service::Init readable = ::File.readable? file Chef::Log.debug "#{@new_resource} exists: #{exists}, readable: #{readable}" exists and readable - end + end, ) Chef::Log.debug "#{@new_resource} enabled: #{@current_resource.enabled}" diff --git a/lib/chef/provider/service/macosx.rb b/lib/chef/provider/service/macosx.rb index 63485903c3..cdd5d934ff 100644 --- a/lib/chef/provider/service/macosx.rb +++ b/lib/chef/provider/service/macosx.rb @@ -224,7 +224,7 @@ class Chef # plist files can come in XML or Binary formats. this command # will make sure we get XML every time. plist_xml = shell_out_with_systems_locale!( - "plutil -convert xml1 -o - #{@plist}" + "plutil -convert xml1 -o - #{@plist}", ).stdout plist_doc = REXML::Document.new(plist_xml) @@ -236,7 +236,7 @@ class Chef plists = PLIST_DIRS.inject([]) do |results, dir| edir = ::File.expand_path(dir) entries = Dir.glob( - "#{edir}/*#{Chef::Util::PathHelper.escape_glob(@current_resource.service_name)}*.plist" + "#{edir}/*#{Chef::Util::PathHelper.escape_glob(@current_resource.service_name)}*.plist", ) entries.any? ? results << entries : results end diff --git a/lib/chef/provider/user/dscl.rb b/lib/chef/provider/user/dscl.rb index 8c282b0d7e..1659e324c0 100644 --- a/lib/chef/provider/user/dscl.rb +++ b/lib/chef/provider/user/dscl.rb @@ -230,7 +230,7 @@ user password using shadow hash.") base_uid = new_resource.system ? 200 : 500 next_uid_guess = base_uid users_uids = run_dscl("list /Users uid") - while(next_uid_guess < search_limit + base_uid) + while next_uid_guess < search_limit + base_uid if users_uids =~ Regexp.new("#{Regexp.escape(next_uid_guess.to_s)}\n") next_uid_guess += 1 else diff --git a/lib/chef/resource/chef_gem.rb b/lib/chef/resource/chef_gem.rb index e08bacc625..4445bf0f89 100644 --- a/lib/chef/resource/chef_gem.rb +++ b/lib/chef/resource/chef_gem.rb @@ -26,7 +26,7 @@ class Chef property :gem_binary, default: "#{RbConfig::CONFIG['bindir']}/gem", callbacks: { - "The chef_gem resource is restricted to the current gem environment, use gem_package to install to other environments." => proc { |v| v == "#{RbConfig::CONFIG['bindir']}/gem" } + "The chef_gem resource is restricted to the current gem environment, use gem_package to install to other environments." => proc { |v| v == "#{RbConfig::CONFIG['bindir']}/gem" }, } property :compile_time, [ true, false, nil ], default: lazy { Chef::Config[:chef_gem_compile_time] }, desired_state: false diff --git a/lib/chef/resource/file/verification.rb b/lib/chef/resource/file/verification.rb index e11035d33f..15ed27347f 100644 --- a/lib/chef/resource/file/verification.rb +++ b/lib/chef/resource/file/verification.rb @@ -110,7 +110,7 @@ class Chef # is interpolated. Until `file` can be deprecated, interpolate both. Chef.log_deprecation( "%{file} is deprecated in verify command and will not be "\ - "supported in Chef 13. Please use %{path} instead." + "supported in Chef 13. Please use %{path} instead.", ) if @command.include?("%{file}") command = @command % { :file => path, :path => path } interpreter = Chef::GuardInterpreter.for_resource(@parent_resource, command, @command_opts) diff --git a/lib/chef/resource/remote_file.rb b/lib/chef/resource/remote_file.rb index 36f1c614d1..933092ec82 100644 --- a/lib/chef/resource/remote_file.rb +++ b/lib/chef/resource/remote_file.rb @@ -51,7 +51,7 @@ class Chef ret = set_or_return(:source, arg, { :callbacks => { - :validate_source => method(:validate_source) + :validate_source => method(:validate_source), } }) if ret.is_a? String Array(ret) diff --git a/lib/chef/user_v1.rb b/lib/chef/user_v1.rb index 3b7dc330df..db44ced9d4 100644 --- a/lib/chef/user_v1.rb +++ b/lib/chef/user_v1.rb @@ -114,7 +114,7 @@ class Chef def to_hash result = { - "username" => @username + "username" => @username, } result["display_name"] = @display_name unless @display_name.nil? result["first_name"] = @first_name unless @first_name.nil? diff --git a/lib/chef/win32/security/sid.rb b/lib/chef/win32/security/sid.rb index 665cba8880..9951b931c9 100644 --- a/lib/chef/win32/security/sid.rb +++ b/lib/chef/win32/security/sid.rb @@ -275,7 +275,7 @@ class Chef status = ERROR_MORE_DATA - while(status == ERROR_MORE_DATA) + while status == ERROR_MORE_DATA status = NetUserEnum(servername, level, filter, bufptr, prefmaxlen, entriesread, totalentries, resume_handle) if status == NERR_Success || status == ERROR_MORE_DATA diff --git a/spec/functional/resource/execute_spec.rb b/spec/functional/resource/execute_spec.rb index dd0f68bebb..72cb53e78e 100644 --- a/spec/functional/resource/execute_spec.rb +++ b/spec/functional/resource/execute_spec.rb @@ -106,7 +106,7 @@ describe Chef::Resource::Execute do it "guard adds additional values in its :environment and runs" do resource.only_if %{ruby -e 'exit 1 if ENV["SGCE_SECRET"] != "regularsecret"'}, { - :environment => { "SGCE_SECRET" => "regularsecret" } + :environment => { "SGCE_SECRET" => "regularsecret" }, } resource.run_action(:run) expect(resource).to be_updated_by_last_action @@ -114,7 +114,7 @@ describe Chef::Resource::Execute do it "guard adds additional values in its :environment and does not run" do resource.only_if %{ruby -e 'exit 1 if ENV["SGCE_SECRET"] == "regularsecret"'}, { - :environment => { "SGCE_SECRET" => "regularsecret" } + :environment => { "SGCE_SECRET" => "regularsecret" }, } resource.run_action(:run) expect(resource).not_to be_updated_by_last_action @@ -122,7 +122,7 @@ describe Chef::Resource::Execute do it "guard overwrites value with its :environment and runs" do resource.only_if %{ruby -e 'exit 1 if ENV["SAWS_SECRET"] != "regularsecret"'}, { - :environment => { "SAWS_SECRET" => "regularsecret" } + :environment => { "SAWS_SECRET" => "regularsecret" }, } resource.run_action(:run) expect(resource).to be_updated_by_last_action @@ -130,7 +130,7 @@ describe Chef::Resource::Execute do it "guard overwrites value with its :environment and does not runs" do resource.only_if %{ruby -e 'exit 1 if ENV["SAWS_SECRET"] == "regularsecret"'}, { - :environment => { "SAWS_SECRET" => "regularsecret" } + :environment => { "SAWS_SECRET" => "regularsecret" }, } resource.run_action(:run) expect(resource).not_to be_updated_by_last_action diff --git a/spec/functional/resource/user/dscl_spec.rb b/spec/functional/resource/user/dscl_spec.rb index 243471c3f7..5d904a980b 100644 --- a/spec/functional/resource/user/dscl_spec.rb +++ b/spec/functional/resource/user/dscl_spec.rb @@ -186,7 +186,7 @@ c5adbbac718b7eb99463a7b679571e0f\ end end - it ":remove action removes the user from the groups and deletes the user"do + it ":remove action removes the user from the groups and deletes the user" do user_resource.run_action(:remove) groups.each do |group| # Do not raise an error when group is empty diff --git a/spec/integration/knife/deps_spec.rb b/spec/integration/knife/deps_spec.rb index d80fb77634..358635d0de 100644 --- a/spec/integration/knife/deps_spec.rb +++ b/spec/integration/knife/deps_spec.rb @@ -357,7 +357,7 @@ EOM before { file "cookbooks/blah/metadata.rb", 'name "blah"' } it "knife deps on a cookbook file shows no dependencies" do knife("deps /cookbooks/blah/metadata.rb").should_succeed( - "/cookbooks/blah/metadata.rb\n" + "/cookbooks/blah/metadata.rb\n", ) end end @@ -693,7 +693,7 @@ EOM end it "knife deps on a cookbook file shows no dependencies" do knife("deps --remote /cookbooks/blah/metadata.rb").should_succeed( - "/cookbooks/blah/metadata.rb\n" + "/cookbooks/blah/metadata.rb\n", ) end end diff --git a/spec/integration/knife/download_spec.rb b/spec/integration/knife/download_spec.rb index 2c9f64b61a..d9a3f4fe87 100644 --- a/spec/integration/knife/download_spec.rb +++ b/spec/integration/knife/download_spec.rb @@ -1192,7 +1192,7 @@ EOM "policies" => { "x" => { "revision_id" => "1.0.0" }, "blah" => { "revision_id" => "1.0.0" }, - } + }, } role "x", {} end @@ -1283,7 +1283,7 @@ EOM "policies" => { "x" => { "revision_id" => "1.0.1" }, "y" => { "revision_id" => "1.0.0" }, - } + }, } file "roles/x.json", { "run_list" => [ "blah" ] } end diff --git a/spec/integration/knife/upload_spec.rb b/spec/integration/knife/upload_spec.rb index 5d136968dd..1d32fe1e49 100644 --- a/spec/integration/knife/upload_spec.rb +++ b/spec/integration/knife/upload_spec.rb @@ -1349,7 +1349,7 @@ EOM "policies" => { "x" => { "revision_id" => "1.0.0" }, "blah" => { "revision_id" => "1.0.0" }, - } + }, } role "x", {} end @@ -1403,7 +1403,7 @@ EOM "policies" => { "x" => { "revision_id" => "1.0.1" }, "y" => { "revision_id" => "1.0.0" }, - } + }, } role "x", { "run_list" => [ "blah" ] } end diff --git a/spec/support/shared/functional/http.rb b/spec/support/shared/functional/http.rb index d6ba709c77..7e9e3f34c5 100644 --- a/spec/support/shared/functional/http.rb +++ b/spec/support/shared/functional/http.rb @@ -81,7 +81,7 @@ module ChefHTTPShared # (expected_content should be uncompressed) @api.get("/nyan_cat_content_length.png", 200, nil, { - "Content-Length" => nyan_uncompressed_size.to_s + "Content-Length" => nyan_uncompressed_size.to_s, } ) { File.open(nyan_uncompressed_filename, "rb") do |f| @@ -109,7 +109,7 @@ module ChefHTTPShared # (expected_content should be uncompressed) @api.get("/nyan_cat_truncated.png", 200, nil, { - "Content-Length" => (nyan_uncompressed_size + 1).to_s + "Content-Length" => (nyan_uncompressed_size + 1).to_s, } ) { File.open(nyan_uncompressed_filename, "rb") do |f| @@ -151,7 +151,7 @@ module ChefHTTPShared # @api.get("/forbidden", 403, "Forbidden", { - "Content-Length" => "Forbidden".bytesize.to_s + "Content-Length" => "Forbidden".bytesize.to_s, } ) diff --git a/spec/support/shared/functional/securable_resource.rb b/spec/support/shared/functional/securable_resource.rb index dd8a0216bc..20be3c5c2f 100644 --- a/spec/support/shared/functional/securable_resource.rb +++ b/spec/support/shared/functional/securable_resource.rb @@ -409,7 +409,7 @@ shared_examples_for "a securable resource without existing target" do expect(explicit_aces).to eq( allowed_acl(SID.Everyone, expected_read_perms) + - allowed_acl(SID.Guest, expected_modify_perms) + allowed_acl(SID.Guest, expected_modify_perms), ) end @@ -420,7 +420,7 @@ shared_examples_for "a securable resource without existing target" do expect(explicit_aces).to eq( denied_acl(SID.Guest, expected_modify_perms) + - allowed_acl(SID.Everyone, expected_read_perms) + allowed_acl(SID.Everyone, expected_read_perms), ) end @@ -431,7 +431,7 @@ shared_examples_for "a securable resource without existing target" do expect(explicit_aces).to eq( denied_acl(SID.Guest, expected_modify_perms) + - allowed_acl(SID.Everyone, expected_read_perms) + allowed_acl(SID.Everyone, expected_read_perms), ) end diff --git a/spec/support/shared/unit/user_and_client_shared.rb b/spec/support/shared/unit/user_and_client_shared.rb index e3862943bc..e3481dfeca 100644 --- a/spec/support/shared/unit/user_and_client_shared.rb +++ b/spec/support/shared/unit/user_and_client_shared.rb @@ -58,8 +58,8 @@ shared_examples_for "user or client create" do let(:chef_key) { { "chef_key" => { - "public_key" => "some_public_key" - } + "public_key" => "some_public_key", + }, } } @@ -75,7 +75,7 @@ shared_examples_for "user or client create" do "chef_key" => { "public_key" => "some_public_key", "private_key" => "some_private_key", - } + }, } } diff --git a/spec/unit/api_client/registration_spec.rb b/spec/unit/api_client/registration_spec.rb index 750223ad14..f086993860 100644 --- a/spec/unit/api_client/registration_spec.rb +++ b/spec/unit/api_client/registration_spec.rb @@ -71,7 +71,7 @@ describe Chef::ApiClient::Registration do { "uri" => "", "chef_key" => { - "public_key" => generated_public_key.to_pem + "public_key" => generated_public_key.to_pem, }, } end diff --git a/spec/unit/application/client_spec.rb b/spec/unit/application/client_spec.rb index ff6f460c13..9383e8e856 100644 --- a/spec/unit/application/client_spec.rb +++ b/spec/unit/application/client_spec.rb @@ -85,7 +85,7 @@ describe Chef::Application::Client, "reconfigure" do "Unforked chef-client interval runs are disabled in Chef 12. Configuration settings: interval = 600 seconds -Enable chef-client interval runs by setting `:client_fork = true` in your config file or adding `--fork` to your command line options." +Enable chef-client interval runs by setting `:client_fork = true` in your config file or adding `--fork` to your command line options.", ) app.reconfigure end diff --git a/spec/unit/application/solo_spec.rb b/spec/unit/application/solo_spec.rb index 4361a2cd33..af504b621c 100644 --- a/spec/unit/application/solo_spec.rb +++ b/spec/unit/application/solo_spec.rb @@ -70,7 +70,7 @@ describe Chef::Application::Solo do "Unforked chef-client interval runs are disabled in Chef 12. Configuration settings: interval = 600 seconds -Enable chef-client interval runs by setting `:client_fork = true` in your config file or adding `--fork` to your command line options." +Enable chef-client interval runs by setting `:client_fork = true` in your config file or adding `--fork` to your command line options.", ) app.reconfigure end diff --git a/spec/unit/audit/audit_reporter_spec.rb b/spec/unit/audit/audit_reporter_spec.rb index ed0aa622cc..1db56a550e 100644 --- a/spec/unit/audit/audit_reporter_spec.rb +++ b/spec/unit/audit/audit_reporter_spec.rb @@ -75,7 +75,7 @@ describe Chef::Audit::AuditReporter do it "posts audit data to server endpoint" do headers = { - "X-Ops-Audit-Report-Protocol-Version" => Chef::Audit::AuditReporter::PROTOCOL_VERSION + "X-Ops-Audit-Report-Protocol-Version" => Chef::Audit::AuditReporter::PROTOCOL_VERSION, } expect(rest).to receive(:post). diff --git a/spec/unit/chef_fs/file_system_spec.rb b/spec/unit/chef_fs/file_system_spec.rb index 9f07197832..71befc426c 100644 --- a/spec/unit/chef_fs/file_system_spec.rb +++ b/spec/unit/chef_fs/file_system_spec.rb @@ -63,7 +63,7 @@ describe Chef::ChefFS::FileSystem do :zz => "", }, :ab => { - :c => "" + :c => "", }, }, :x => "", diff --git a/spec/unit/cookbook/metadata_spec.rb b/spec/unit/cookbook/metadata_spec.rb index 0107667fcd..976ab61e38 100644 --- a/spec/unit/cookbook/metadata_spec.rb +++ b/spec/unit/cookbook/metadata_spec.rb @@ -311,7 +311,7 @@ describe Chef::Cookbook::Metadata do it "strips out self-dependencies", :chef_lt_13_only do metadata.name("foo") expect(Chef::Log).to receive(:warn).with( - "Ignoring self-dependency in cookbook foo, please remove it (in the future this will be fatal)." + "Ignoring self-dependency in cookbook foo, please remove it (in the future this will be fatal).", ) metadata.depends("foo") expect(metadata.dependencies).to eql({}) diff --git a/spec/unit/cookbook/synchronizer_spec.rb b/spec/unit/cookbook/synchronizer_spec.rb index c869ee8ff3..97e7569cf4 100644 --- a/spec/unit/cookbook/synchronizer_spec.rb +++ b/spec/unit/cookbook/synchronizer_spec.rb @@ -109,7 +109,7 @@ describe Chef::CookbookSynchronizer do let(:cookbook_manifest) do { - "cookbook_a" => cookbook_a + "cookbook_a" => cookbook_a, } end diff --git a/spec/unit/cookbook_site_streaming_uploader_spec.rb b/spec/unit/cookbook_site_streaming_uploader_spec.rb index a2511fcdf1..0e9c277b11 100644 --- a/spec/unit/cookbook_site_streaming_uploader_spec.rb +++ b/spec/unit/cookbook_site_streaming_uploader_spec.rb @@ -108,7 +108,7 @@ describe Chef::CookbookSiteStreamingUploader do it "should be able to receive strings to attach as argument" do Chef::CookbookSiteStreamingUploader.make_request(:put, @uri, "bill", @secret_filename, { - :mystring => "Lorem ipsum" + :mystring => "Lorem ipsum", }) end diff --git a/spec/unit/cookbook_version_file_specificity_spec.rb b/spec/unit/cookbook_version_file_specificity_spec.rb index 13be1c26ec..2bc20ac64e 100644 --- a/spec/unit/cookbook_version_file_specificity_spec.rb +++ b/spec/unit/cookbook_version_file_specificity_spec.rb @@ -197,7 +197,7 @@ describe Chef::CookbookVersion, "file specificity" do :checksum => "csum4-platver-full-2", :specificity => "fakeos-1", }, - ] + ], } end diff --git a/spec/unit/environment_spec.rb b/spec/unit/environment_spec.rb index f4026c7e78..4689c60b39 100644 --- a/spec/unit/environment_spec.rb +++ b/spec/unit/environment_spec.rb @@ -417,8 +417,8 @@ describe Chef::Environment do "name" => "foo", "default_attributes" => { "foo" => { - "bar" => 1 - } + "bar" => 1, + }, }, "json_class" => "Chef::Environment", "description" => "desc", diff --git a/spec/unit/http/basic_client_spec.rb b/spec/unit/http/basic_client_spec.rb index 4abdb52620..97356b4887 100644 --- a/spec/unit/http/basic_client_spec.rb +++ b/spec/unit/http/basic_client_spec.rb @@ -113,7 +113,7 @@ describe "HTTP Connection" do context "when an empty proxy is set by the environment" do let(:env) do { - "https_proxy" => "" + "https_proxy" => "", } end diff --git a/spec/unit/http/validate_content_length_spec.rb b/spec/unit/http/validate_content_length_spec.rb index c852d7b5c7..37bf6c2180 100644 --- a/spec/unit/http/validate_content_length_spec.rb +++ b/spec/unit/http/validate_content_length_spec.rb @@ -39,7 +39,7 @@ describe Chef::HTTP::ValidateContentLength do let(:response_body) { "Thanks for checking in." } let(:response_headers) { { - "content-length" => content_length_value + "content-length" => content_length_value, } } diff --git a/spec/unit/knife/client_delete_spec.rb b/spec/unit/knife/client_delete_spec.rb index f1af3c3d4e..82ef902e09 100644 --- a/spec/unit/knife/client_delete_spec.rb +++ b/spec/unit/knife/client_delete_spec.rb @@ -23,7 +23,7 @@ describe Chef::Knife::ClientDelete do @knife = Chef::Knife::ClientDelete.new # defaults @knife.config = { - :delete_validators => false + :delete_validators => false, } @knife.name_args = [ "adam" ] end diff --git a/spec/unit/knife/cookbook_delete_spec.rb b/spec/unit/knife/cookbook_delete_spec.rb index 4bca4e06ed..9bf4c81a73 100644 --- a/spec/unit/knife/cookbook_delete_spec.rb +++ b/spec/unit/knife/cookbook_delete_spec.rb @@ -129,7 +129,7 @@ describe Chef::Knife::CookbookDelete do expect(@knife).to receive(:rest).and_return(@rest_mock) @cookbook_data = { "foobar" => { "versions" => [{ "version" => "1.0.0" }, { "version" => "1.1.0" }, - { "version" => "2.0.0" } ] } + { "version" => "2.0.0" } ] }, } end diff --git a/spec/unit/knife/cookbook_download_spec.rb b/spec/unit/knife/cookbook_download_spec.rb index 991abea776..38a4974774 100644 --- a/spec/unit/knife/cookbook_download_spec.rb +++ b/spec/unit/knife/cookbook_download_spec.rb @@ -73,7 +73,7 @@ describe Chef::Knife::CookbookDownload do and_return(@cookbook_mock) end - it "should determine which version if one was not explicitly specified"do + it "should determine which version if one was not explicitly specified" do allow(@cookbook_mock).to receive(:manifest).and_return({}) expect(@knife).to receive(:determine_version).and_return("1.0.0") expect(File).to receive(:exists?).with("/var/tmp/chef/foobar-1.0.0").and_return(false) diff --git a/spec/unit/knife/cookbook_show_spec.rb b/spec/unit/knife/cookbook_show_spec.rb index 0183577ec1..eeb7fef272 100644 --- a/spec/unit/knife/cookbook_show_spec.rb +++ b/spec/unit/knife/cookbook_show_spec.rb @@ -51,7 +51,7 @@ describe Chef::Knife::CookbookShow do { "version" => "0.9.0", "url" => "http://url/cookbookx/cookbook_name/0.9.0" }, { "version" => "0.8.0", "url" => "http://url/cookbooks/cookbook_name/0.8.0" }, ], - } + }, } end @@ -94,7 +94,7 @@ describe Chef::Knife::CookbookShow do :checksum => "1234", :url => "http://example.org/files/default.rb", }, - ] + ], } @cookbook_response.manifest = @manifest @response = { "name" => "default.rb", "url" => "http://example.org/files/default.rb", "checksum" => "1234", "path" => "recipes/default.rb" } @@ -119,7 +119,7 @@ describe Chef::Knife::CookbookShow do :checksum => "1234", :url => "http://example.org/files/default.rb", }, - ] + ], } @response = "Example recipe text" end @@ -166,7 +166,7 @@ describe Chef::Knife::CookbookShow do :specificity => "default", :url => "http://example.org/files/4444", }, - ] + ], } @response = "Example recipe text" diff --git a/spec/unit/knife/cookbook_site_share_spec.rb b/spec/unit/knife/cookbook_site_share_spec.rb index d5e3915896..9339114d2a 100644 --- a/spec/unit/knife/cookbook_site_share_spec.rb +++ b/spec/unit/knife/cookbook_site_share_spec.rb @@ -60,7 +60,7 @@ describe Chef::Knife::CookbookSiteShare do @bad_category_response = { "error_code" => "NOT_FOUND", "error_messages" => [ - "Resource does not exist." + "Resource does not exist.", ], } end diff --git a/spec/unit/knife/core/bootstrap_context_spec.rb b/spec/unit/knife/core/bootstrap_context_spec.rb index efcc2659dd..6465e18ac9 100644 --- a/spec/unit/knife/core/bootstrap_context_spec.rb +++ b/spec/unit/knife/core/bootstrap_context_spec.rb @@ -160,7 +160,7 @@ EXPECTED describe "when a bootstrap_version is specified" do let(:chef_config) do { - :knife => { :bootstrap_version => "11.12.4" } + :knife => { :bootstrap_version => "11.12.4" }, } end @@ -172,7 +172,7 @@ EXPECTED describe "when a pre-release bootstrap_version is specified" do let(:chef_config) do { - :knife => { :bootstrap_version => "11.12.4.rc.0" } + :knife => { :bootstrap_version => "11.12.4.rc.0" }, } end @@ -196,7 +196,7 @@ EXPECTED describe "when configured in config" do let(:chef_config) do { - :knife => { :ssl_verify_mode => :verify_peer } + :knife => { :ssl_verify_mode => :verify_peer }, } end @@ -222,7 +222,7 @@ EXPECTED describe "when configured in config" do let(:chef_config) do { - :knife => { :verify_api_cert => :false } + :knife => { :verify_api_cert => :false }, } end diff --git a/spec/unit/knife/core/custom_manifest_loader_spec.rb b/spec/unit/knife/core/custom_manifest_loader_spec.rb index 3668fca6ad..814ac8a027 100644 --- a/spec/unit/knife/core/custom_manifest_loader_spec.rb +++ b/spec/unit/knife/core/custom_manifest_loader_spec.rb @@ -23,10 +23,10 @@ describe Chef::Knife::SubcommandLoader::CustomManifestLoader do { "plugins" => { "knife-ec2" => { "paths" => [ - ec2_server_create_plugin - ] - } - } + ec2_server_create_plugin, + ], + }, + }, } end let(:loader) do diff --git a/spec/unit/knife/core/hashed_command_loader_spec.rb b/spec/unit/knife/core/hashed_command_loader_spec.rb index 4ae046cc09..0135868bf5 100644 --- a/spec/unit/knife/core/hashed_command_loader_spec.rb +++ b/spec/unit/knife/core/hashed_command_loader_spec.rb @@ -31,13 +31,13 @@ describe Chef::Knife::SubcommandLoader::HashedCommandLoader do }, "plugins_by_category" => { "cool" => [ - "cool_a" + "cool_a", ], "cooler" => [ - "cooler_b" + "cooler_b", ], }, - } + }, } } diff --git a/spec/unit/knife/core/ui_spec.rb b/spec/unit/knife/core/ui_spec.rb index 58f13ef4a0..0b9547fc1f 100644 --- a/spec/unit/knife/core/ui_spec.rb +++ b/spec/unit/knife/core/ui_spec.rb @@ -414,7 +414,7 @@ EOM { "version" => "2.0.0", "url" => "http://url/cookbooks/2.0.0" }, { "version" => "1.0.0", "url" => "http://url/cookbooks/1.0.0" }, ], - } + }, } end @@ -430,7 +430,7 @@ EOM "cookbook_name" => { "1.0.0" => "http://url/cookbooks/1.0.0", "2.0.0" => "http://url/cookbooks/2.0.0", - "3.0.0" => "http://url/cookbooks/3.0.0" } + "3.0.0" => "http://url/cookbooks/3.0.0" }, } @ui.config[:with_uri] = true expect(@ui.format_cookbook_list_for_display(@item)).to eq(response) diff --git a/spec/unit/knife/key_create_spec.rb b/spec/unit/knife/key_create_spec.rb index 87315bd5df..146b6a904b 100644 --- a/spec/unit/knife/key_create_spec.rb +++ b/spec/unit/knife/key_create_spec.rb @@ -102,7 +102,7 @@ Tfuc9dUYsFjptWYrV6pfEQ+bgo1OGBXORBFcFL+2D7u9JYquKrMgosznHoEkQNLo context "when the command is run" do let(:expected_hash) { { - actor_field_name => "charmander" + actor_field_name => "charmander", } } diff --git a/spec/unit/knife/key_edit_spec.rb b/spec/unit/knife/key_edit_spec.rb index 44300b3e0f..9195e97135 100644 --- a/spec/unit/knife/key_edit_spec.rb +++ b/spec/unit/knife/key_edit_spec.rb @@ -99,7 +99,7 @@ Tfuc9dUYsFjptWYrV6pfEQ+bgo1OGBXORBFcFL+2D7u9JYquKrMgosznHoEkQNLo context "when the command is run" do let(:expected_hash) { { - actor_field_name => "charmander" + actor_field_name => "charmander", } } let(:new_keyname) { "charizard-key" } diff --git a/spec/unit/knife/node_delete_spec.rb b/spec/unit/knife/node_delete_spec.rb index e2cda8751f..d4ef32bccf 100644 --- a/spec/unit/knife/node_delete_spec.rb +++ b/spec/unit/knife/node_delete_spec.rb @@ -23,7 +23,7 @@ describe Chef::Knife::NodeDelete do Chef::Config[:node_name] = "webmonkey.example.com" @knife = Chef::Knife::NodeDelete.new @knife.config = { - :print_after => nil + :print_after => nil, } @knife.name_args = [ "adam" ] allow(@knife).to receive(:output).and_return(true) diff --git a/spec/unit/knife/node_from_file_spec.rb b/spec/unit/knife/node_from_file_spec.rb index 89b2b8156f..61c63c150e 100644 --- a/spec/unit/knife/node_from_file_spec.rb +++ b/spec/unit/knife/node_from_file_spec.rb @@ -25,7 +25,7 @@ describe Chef::Knife::NodeFromFile do Chef::Config[:node_name] = "webmonkey.example.com" @knife = Chef::Knife::NodeFromFile.new @knife.config = { - :print_after => nil + :print_after => nil, } @knife.name_args = [ "adam.rb" ] allow(@knife).to receive(:output).and_return(true) diff --git a/spec/unit/knife/node_run_list_add_spec.rb b/spec/unit/knife/node_run_list_add_spec.rb index eb897c146b..e11bf78029 100644 --- a/spec/unit/knife/node_run_list_add_spec.rb +++ b/spec/unit/knife/node_run_list_add_spec.rb @@ -23,7 +23,7 @@ describe Chef::Knife::NodeRunListAdd do Chef::Config[:node_name] = "webmonkey.example.com" @knife = Chef::Knife::NodeRunListAdd.new @knife.config = { - :after => nil + :after => nil, } @knife.name_args = [ "adam", "role[monkey]" ] allow(@knife).to receive(:output).and_return(true) diff --git a/spec/unit/knife/role_bulk_delete_spec.rb b/spec/unit/knife/role_bulk_delete_spec.rb index 9a4a1a0bc7..e9054c1d00 100644 --- a/spec/unit/knife/role_bulk_delete_spec.rb +++ b/spec/unit/knife/role_bulk_delete_spec.rb @@ -23,7 +23,7 @@ describe Chef::Knife::RoleBulkDelete do Chef::Config[:node_name] = "webmonkey.example.com" @knife = Chef::Knife::RoleBulkDelete.new @knife.config = { - :print_after => nil + :print_after => nil, } @knife.name_args = ["."] @stdout = StringIO.new diff --git a/spec/unit/knife/role_create_spec.rb b/spec/unit/knife/role_create_spec.rb index 3d06a871e2..9466d9642c 100644 --- a/spec/unit/knife/role_create_spec.rb +++ b/spec/unit/knife/role_create_spec.rb @@ -23,7 +23,7 @@ describe Chef::Knife::RoleCreate do Chef::Config[:node_name] = "webmonkey.example.com" @knife = Chef::Knife::RoleCreate.new @knife.config = { - :description => nil + :description => nil, } @knife.name_args = [ "adam" ] allow(@knife).to receive(:output).and_return(true) diff --git a/spec/unit/knife/role_delete_spec.rb b/spec/unit/knife/role_delete_spec.rb index cc65674a08..f095e5ba2d 100644 --- a/spec/unit/knife/role_delete_spec.rb +++ b/spec/unit/knife/role_delete_spec.rb @@ -23,7 +23,7 @@ describe Chef::Knife::RoleDelete do Chef::Config[:node_name] = "webmonkey.example.com" @knife = Chef::Knife::RoleDelete.new @knife.config = { - :print_after => nil + :print_after => nil, } @knife.name_args = [ "adam" ] allow(@knife).to receive(:output).and_return(true) diff --git a/spec/unit/knife/role_env_run_list_add_spec.rb b/spec/unit/knife/role_env_run_list_add_spec.rb index fe4cb6d057..4738101f90 100644 --- a/spec/unit/knife/role_env_run_list_add_spec.rb +++ b/spec/unit/knife/role_env_run_list_add_spec.rb @@ -25,7 +25,7 @@ describe Chef::Knife::RoleEnvRunListAdd do # Chef::Config[:env_name] = "QA" @knife = Chef::Knife::RoleEnvRunListAdd.new @knife.config = { - :after => nil + :after => nil, } @knife.name_args = [ "will", "QA", "role[monkey]" ] allow(@knife).to receive(:output).and_return(true) diff --git a/spec/unit/knife/role_env_run_list_clear_spec.rb b/spec/unit/knife/role_env_run_list_clear_spec.rb index b7af9b7d57..c9c24858c0 100644 --- a/spec/unit/knife/role_env_run_list_clear_spec.rb +++ b/spec/unit/knife/role_env_run_list_clear_spec.rb @@ -28,7 +28,7 @@ describe Chef::Knife::RoleEnvRunListClear do @knife = Chef::Knife::RoleEnvRunListClear.new @knife.config = { - :print_after => nil + :print_after => nil, } @knife.name_args = %w{will QA} allow(@knife).to receive(:output).and_return(true) diff --git a/spec/unit/knife/role_env_run_list_remove_spec.rb b/spec/unit/knife/role_env_run_list_remove_spec.rb index 180dbf1d43..8a077f1de3 100644 --- a/spec/unit/knife/role_env_run_list_remove_spec.rb +++ b/spec/unit/knife/role_env_run_list_remove_spec.rb @@ -28,7 +28,7 @@ describe Chef::Knife::RoleEnvRunListRemove do @knife = Chef::Knife::RoleEnvRunListRemove.new @knife.config = { - :print_after => nil + :print_after => nil, } @knife.name_args = [ "will", "QA", "role[monkey]" ] allow(@knife).to receive(:output).and_return(true) diff --git a/spec/unit/knife/role_env_run_list_replace_spec.rb b/spec/unit/knife/role_env_run_list_replace_spec.rb index fcfbe99e7c..08dcdd90e2 100644 --- a/spec/unit/knife/role_env_run_list_replace_spec.rb +++ b/spec/unit/knife/role_env_run_list_replace_spec.rb @@ -28,7 +28,7 @@ describe Chef::Knife::RoleEnvRunListReplace do @knife = Chef::Knife::RoleEnvRunListReplace.new @knife.config = { - :print_after => nil + :print_after => nil, } @knife.name_args = [ "will", "QA", "role[dude]", "role[person]" ] allow(@knife).to receive(:output).and_return(true) diff --git a/spec/unit/knife/role_env_run_list_set_spec.rb b/spec/unit/knife/role_env_run_list_set_spec.rb index 6fb187447d..aed1c9fe1e 100644 --- a/spec/unit/knife/role_env_run_list_set_spec.rb +++ b/spec/unit/knife/role_env_run_list_set_spec.rb @@ -28,7 +28,7 @@ describe Chef::Knife::RoleEnvRunListSet do @knife = Chef::Knife::RoleEnvRunListSet.new @knife.config = { - :print_after => nil + :print_after => nil, } @knife.name_args = [ "will", "QA", "role[owen]", "role[mauntel]" ] allow(@knife).to receive(:output).and_return(true) diff --git a/spec/unit/knife/role_from_file_spec.rb b/spec/unit/knife/role_from_file_spec.rb index 741ff99741..104894df17 100644 --- a/spec/unit/knife/role_from_file_spec.rb +++ b/spec/unit/knife/role_from_file_spec.rb @@ -25,7 +25,7 @@ describe Chef::Knife::RoleFromFile do Chef::Config[:node_name] = "webmonkey.example.com" @knife = Chef::Knife::RoleFromFile.new @knife.config = { - :print_after => nil + :print_after => nil, } @knife.name_args = [ "adam.rb" ] allow(@knife).to receive(:output).and_return(true) diff --git a/spec/unit/knife/role_run_list_add_spec.rb b/spec/unit/knife/role_run_list_add_spec.rb index 419fbdfedb..fe7318c040 100644 --- a/spec/unit/knife/role_run_list_add_spec.rb +++ b/spec/unit/knife/role_run_list_add_spec.rb @@ -25,7 +25,7 @@ describe Chef::Knife::RoleRunListAdd do # Chef::Config[:env_name] = "QA" @knife = Chef::Knife::RoleRunListAdd.new @knife.config = { - :after => nil + :after => nil, } @knife.name_args = [ "will", "role[monkey]" ] allow(@knife).to receive(:output).and_return(true) diff --git a/spec/unit/knife/role_run_list_clear_spec.rb b/spec/unit/knife/role_run_list_clear_spec.rb index 61dfc8fa89..4ed1f312b0 100644 --- a/spec/unit/knife/role_run_list_clear_spec.rb +++ b/spec/unit/knife/role_run_list_clear_spec.rb @@ -27,7 +27,7 @@ describe Chef::Knife::RoleRunListClear do @knife = Chef::Knife::RoleRunListClear.new @knife.config = { - :print_after => nil + :print_after => nil, } @knife.name_args = [ "will" ] allow(@knife).to receive(:output).and_return(true) diff --git a/spec/unit/knife/role_run_list_remove_spec.rb b/spec/unit/knife/role_run_list_remove_spec.rb index 704c3d3cb4..087bc2c6ee 100644 --- a/spec/unit/knife/role_run_list_remove_spec.rb +++ b/spec/unit/knife/role_run_list_remove_spec.rb @@ -27,7 +27,7 @@ describe Chef::Knife::RoleRunListRemove do @knife = Chef::Knife::RoleRunListRemove.new @knife.config = { - :print_after => nil + :print_after => nil, } @knife.name_args = [ "will", "role[monkey]" ] allow(@knife).to receive(:output).and_return(true) diff --git a/spec/unit/knife/role_run_list_replace_spec.rb b/spec/unit/knife/role_run_list_replace_spec.rb index 91e4993630..2bc060ae2d 100644 --- a/spec/unit/knife/role_run_list_replace_spec.rb +++ b/spec/unit/knife/role_run_list_replace_spec.rb @@ -27,7 +27,7 @@ describe Chef::Knife::RoleRunListReplace do @knife = Chef::Knife::RoleRunListReplace.new @knife.config = { - :print_after => nil + :print_after => nil, } @knife.name_args = [ "will", "role[dude]", "role[person]" ] allow(@knife).to receive(:output).and_return(true) diff --git a/spec/unit/knife/role_run_list_set_spec.rb b/spec/unit/knife/role_run_list_set_spec.rb index ad088e5d0f..27b4d9fea1 100644 --- a/spec/unit/knife/role_run_list_set_spec.rb +++ b/spec/unit/knife/role_run_list_set_spec.rb @@ -27,7 +27,7 @@ describe Chef::Knife::RoleRunListSet do @knife = Chef::Knife::RoleRunListSet.new @knife.config = { - :print_after => nil + :print_after => nil, } @knife.name_args = [ "will", "role[owen]", "role[mauntel]" ] allow(@knife).to receive(:output).and_return(true) diff --git a/spec/unit/mixin/params_validate_spec.rb b/spec/unit/mixin/params_validate_spec.rb index b3bd7af159..38e3ba742e 100644 --- a/spec/unit/mixin/params_validate_spec.rb +++ b/spec/unit/mixin/params_validate_spec.rb @@ -61,8 +61,8 @@ describe Chef::Mixin::ParamsValidate do { :one => "string" }, { :one => { - :kind_of => String - } + :kind_of => String, + }, }, ) }.not_to raise_error @@ -72,8 +72,8 @@ describe Chef::Mixin::ParamsValidate do { :one => "string" }, { :one => { - :kind_of => Array - } + :kind_of => Array, + }, }, ) }.to raise_error(ArgumentError) @@ -85,8 +85,8 @@ describe Chef::Mixin::ParamsValidate do { :one => "string" }, { :one => { - :required => true - } + :required => true, + }, }, ) }.not_to raise_error @@ -96,8 +96,8 @@ describe Chef::Mixin::ParamsValidate do { :two => "string" }, { :one => { - :required => true - } + :required => true, + }, }, ) }.to raise_error(ArgumentError) @@ -107,8 +107,8 @@ describe Chef::Mixin::ParamsValidate do { :two => "string" }, { :one => { - :required => false - } + :required => false, + }, }, ) }.not_to raise_error @@ -120,8 +120,8 @@ describe Chef::Mixin::ParamsValidate do { :one => @vo }, { :one => { - :respond_to => "validate" - } + :respond_to => "validate", + }, }, ) }.not_to raise_error @@ -131,8 +131,8 @@ describe Chef::Mixin::ParamsValidate do { :one => @vo }, { :one => { - :respond_to => "monkey" - } + :respond_to => "monkey", + }, }, ) }.to raise_error(ArgumentError) @@ -144,8 +144,8 @@ describe Chef::Mixin::ParamsValidate do { :one => @vo }, { :one => { - :respond_to => %w{validate music} - } + :respond_to => %w{validate music}, + }, }, ) }.not_to raise_error @@ -155,8 +155,8 @@ describe Chef::Mixin::ParamsValidate do { :one => @vo }, { :one => { - :respond_to => %w{monkey validate} - } + :respond_to => %w{monkey validate}, + }, }, ) }.to raise_error(ArgumentError) @@ -166,8 +166,8 @@ describe Chef::Mixin::ParamsValidate do arguments = Hash.new @vo.validate(arguments, { :one => { - :default => "is the loneliest number" - } + :default => "is the loneliest number", + }, },) expect(arguments[:one]).to eq("is the loneliest number") end @@ -178,8 +178,8 @@ describe Chef::Mixin::ParamsValidate do { :one => "is good" }, { :one => { - :regex => /^is good$/ - } + :regex => /^is good$/, + }, }, ) }.not_to raise_error @@ -189,8 +189,8 @@ describe Chef::Mixin::ParamsValidate do { :one => "is good" }, { :one => { - :regex => /^is bad$/ - } + :regex => /^is bad$/, + }, }, ) }.to raise_error(ArgumentError) @@ -205,9 +205,9 @@ describe Chef::Mixin::ParamsValidate do :callbacks => { "should be equal to is good" => lambda { |a| a == "is good" - } - } - } + }, + }, + }, }, ) }.not_to raise_error @@ -220,9 +220,9 @@ describe Chef::Mixin::ParamsValidate do :callbacks => { "should be equal to 'is good'" => lambda { |a| a == "is good" - } - } - } + }, + }, + }, }, ) }.to raise_error(ArgumentError) @@ -241,7 +241,7 @@ describe Chef::Mixin::ParamsValidate do :callbacks => { "should be your friend" => lambda { |a| a == "is good" - } + }, }, :required => true, }, @@ -265,7 +265,7 @@ describe Chef::Mixin::ParamsValidate do :callbacks => { "should be your friend" => lambda { |a| a == "is good" - } + }, }, :required => true, }, @@ -284,8 +284,8 @@ describe Chef::Mixin::ParamsValidate do { :one => "two" }, { :one => { - :busted => "check" - } + :busted => "check", + }, }, ) }.to raise_error(ArgumentError) @@ -303,8 +303,8 @@ describe Chef::Mixin::ParamsValidate do { :one => "string" }, { :one => { - :kind_of => [ String, Array ] - } + :kind_of => [ String, Array ], + }, }, ) }.not_to raise_error @@ -313,8 +313,8 @@ describe Chef::Mixin::ParamsValidate do { :one => ["string"] }, { :one => { - :kind_of => [ String, Array ] - } + :kind_of => [ String, Array ], + }, }, ) }.not_to raise_error @@ -323,8 +323,8 @@ describe Chef::Mixin::ParamsValidate do { :one => Hash.new }, { :one => { - :kind_of => [ String, Array ] - } + :kind_of => [ String, Array ], + }, }, ) }.to raise_error(ArgumentError) diff --git a/spec/unit/mixin/shell_out_spec.rb b/spec/unit/mixin/shell_out_spec.rb index 12336b1dbb..e2e282da24 100644 --- a/spec/unit/mixin/shell_out_spec.rb +++ b/spec/unit/mixin/shell_out_spec.rb @@ -143,7 +143,7 @@ describe Chef::Mixin::ShellOut do "LC_ALL" => Chef::Config[:internal_locale], "LANG" => Chef::Config[:internal_locale], "LANGUAGE" => Chef::Config[:internal_locale], - } + }, },).and_return(true) shell_out_obj.shell_out(cmd, options) end @@ -156,7 +156,7 @@ describe Chef::Mixin::ShellOut do "LC_ALL" => Chef::Config[:internal_locale], "LANG" => Chef::Config[:internal_locale], "LANGUAGE" => Chef::Config[:internal_locale], - } + }, },).and_return(true) shell_out_obj.shell_out(cmd, options) expect(options[:environment].has_key?("LC_ALL")).to be false @@ -184,7 +184,7 @@ describe Chef::Mixin::ShellOut do "LC_ALL" => Chef::Config[:internal_locale], "LANG" => Chef::Config[:internal_locale], "LANGUAGE" => Chef::Config[:internal_locale], - } + }, },).and_return(true) shell_out_obj.shell_out(cmd, options) end @@ -197,7 +197,7 @@ describe Chef::Mixin::ShellOut do "LC_ALL" => Chef::Config[:internal_locale], "LANG" => Chef::Config[:internal_locale], "LANGUAGE" => Chef::Config[:internal_locale], - } + }, },).and_return(true) shell_out_obj.shell_out(cmd, options) expect(options[:env].has_key?("LC_ALL")).to be false @@ -227,7 +227,7 @@ describe Chef::Mixin::ShellOut do "LC_ALL" => Chef::Config[:internal_locale], "LANG" => Chef::Config[:internal_locale], "LANGUAGE" => Chef::Config[:internal_locale], - } + }, },).and_return(true) shell_out_obj.shell_out(cmd) end diff --git a/spec/unit/node/attribute_spec.rb b/spec/unit/node/attribute_spec.rb index aaca47d951..024599bcee 100644 --- a/spec/unit/node/attribute_spec.rb +++ b/spec/unit/node/attribute_spec.rb @@ -162,7 +162,7 @@ describe Chef::Node::Attribute do "hot" => { "day" => "sunday" }, "fire" => "still burn", "music" => { - "mars_volta" => "cicatriz" + "mars_volta" => "cicatriz", }, } @automatic_hash = { "week" => "friday" } @@ -1003,7 +1003,7 @@ describe Chef::Node::Attribute do %w{one six}, %w{snack cookies}, ["snakes", "on a plane"], - ] + ], ) end end diff --git a/spec/unit/node_spec.rb b/spec/unit/node_spec.rb index 5304ac9f92..afb491f13a 100644 --- a/spec/unit/node_spec.rb +++ b/spec/unit/node_spec.rb @@ -438,13 +438,13 @@ describe Chef::Node do context "with real arrays" do before do node.role_default["mysql"]["server"] = [ { - "port" => 1234 + "port" => 1234, } ] node.normal["mysql"]["server"] = [ { - "port" => 2345 + "port" => 2345, } ] node.override["mysql"]["server"] = [ { - "port" => 3456 + "port" => 3456, } ] end @@ -610,11 +610,11 @@ describe Chef::Node do node.force_default["mysql"]["server"]["port"] = 2345 node.force_default!["mysql"]["server"] = { - "data_dir" => "/my_raid_volume/lib/mysql" + "data_dir" => "/my_raid_volume/lib/mysql", } expect( node["mysql"]["server"] ).to eql({ - "data_dir" => "/my_raid_volume/lib/mysql" + "data_dir" => "/my_raid_volume/lib/mysql", },) end @@ -624,13 +624,13 @@ describe Chef::Node do node.force_default["mysql"]["server"]["port"] = 3456 node.force_default!["mysql"]["server"] = { - "data_dir" => "/my_raid_volume/lib/mysql" + "data_dir" => "/my_raid_volume/lib/mysql", } expect( node["mysql"]["server"]["port"] ).to be_nil expect( node["mysql"]["server"]["data_dir"] ).to eql("/my_raid_volume/lib/mysql") expect( node["mysql"]["server"] ).to eql({ - "data_dir" => "/my_raid_volume/lib/mysql" + "data_dir" => "/my_raid_volume/lib/mysql", },) end @@ -641,7 +641,7 @@ describe Chef::Node do node.override["mysql"]["server"]["service_name"] = "fancypants-sql" node.force_default!["mysql"]["server"] = { - "data_dir" => "/my_raid_volume/lib/mysql" + "data_dir" => "/my_raid_volume/lib/mysql", } expect( node["mysql"]["server"]["port"] ).to be_nil @@ -654,7 +654,7 @@ describe Chef::Node do it "will autovivify" do node.force_default!["mysql"]["server"] = { - "data_dir" => "/my_raid_volume/lib/mysql" + "data_dir" => "/my_raid_volume/lib/mysql", } expect( node["mysql"]["server"]["data_dir"] ).to eql("/my_raid_volume/lib/mysql") end @@ -666,7 +666,7 @@ describe Chef::Node do node.default["mysql"]["server"]["service_name"] = "fancypants-sql" node.force_override!["mysql"]["server"] = { - "data_dir" => "/my_raid_volume/lib/mysql" + "data_dir" => "/my_raid_volume/lib/mysql", } expect( node["mysql"]["server"]["port"] ).to be_nil @@ -681,7 +681,7 @@ describe Chef::Node do node.override["mysql"] = false node.force_override["mysql"] = true node.force_override!["mysql"]["server"] = { - "data_dir" => "/my_raid_volume/lib/mysql" + "data_dir" => "/my_raid_volume/lib/mysql", } expect( node["mysql"]["server"]["data_dir"] ).to eql("/my_raid_volume/lib/mysql") end @@ -689,10 +689,10 @@ describe Chef::Node do it "when overwriting an array with a hash" do node.force_override["mysql"][0] = true node.force_override!["mysql"]["server"] = { - "data_dir" => "/my_raid_volume/lib/mysql" + "data_dir" => "/my_raid_volume/lib/mysql", } expect( node["mysql"]["server"] ).to eql({ - "data_dir" => "/my_raid_volume/lib/mysql" + "data_dir" => "/my_raid_volume/lib/mysql", },) end end @@ -1372,7 +1372,7 @@ describe Chef::Node do "interfaces" => { "eth0" => {}, "eth1" => {}, - } + }, }, }, "default" => {}, "normal" => {}, "override" => {} @@ -1381,12 +1381,12 @@ describe Chef::Node do selected_data = { "automatic" => { "filesystem" => { - "/dev/disk0s2" => { "size" => "10mb" } + "/dev/disk0s2" => { "size" => "10mb" }, }, "network" => { "interfaces" => { - "eth0" => {} - } + "eth0" => {}, + }, }, }, "default" => {}, "normal" => {}, "override" => {} @@ -1400,30 +1400,30 @@ describe Chef::Node do it "should save false-y whitelisted attributes" do Chef::Config[:default_attribute_whitelist] = [ - "foo/bar/baz" + "foo/bar/baz", ] data = { "default" => { "foo" => { "bar" => { - "baz" => false + "baz" => false, }, "other" => { - "stuff" => true + "stuff" => true, }, - } - } + }, + }, } selected_data = { "default" => { "foo" => { "bar" => { - "baz" => false - } - } - } + "baz" => false, + }, + }, + }, } node.name("falsey-monkey") @@ -1440,7 +1440,7 @@ describe Chef::Node do "filesystem" => { "/dev/disk0s2" => { "size" => "10mb" }, "map - autohome" => { "size" => "10mb" }, - } + }, }, "default" => {}, "normal" => {}, "override" => {} } diff --git a/spec/unit/platform_spec.rb b/spec/unit/platform_spec.rb index e37e00bc43..264cadee81 100644 --- a/spec/unit/platform_spec.rb +++ b/spec/unit/platform_spec.rb @@ -34,7 +34,7 @@ describe Chef::Platform do Chef::Platform.platforms = { :darwin => { ">= 10.11" => { - :file => "new_darwinian" + :file => "new_darwinian", }, "9.2.2" => { :file => "darwinian", diff --git a/spec/unit/policy_builder/policyfile_spec.rb b/spec/unit/policy_builder/policyfile_spec.rb index 0e73def3e1..6dab6d14b2 100644 --- a/spec/unit/policy_builder/policyfile_spec.rb +++ b/spec/unit/policy_builder/policyfile_spec.rb @@ -560,7 +560,7 @@ describe Chef::PolicyBuilder::Policyfile do let(:parsed_policyfile_json) do basic_valid_policy_data.dup.tap do |p| p["named_run_lists"] = { - "deploy-app" => [ "recipe[example1::default]" ] + "deploy-app" => [ "recipe[example1::default]" ], } end end diff --git a/spec/unit/property/state_spec.rb b/spec/unit/property/state_spec.rb index f553991903..be19dd7ec2 100644 --- a/spec/unit/property/state_spec.rb +++ b/spec/unit/property/state_spec.rb @@ -228,7 +228,7 @@ describe "Chef::Resource#identity and #state" do expect(resource.state_for_resource_reporter).to eq(custom_property: 6) expect(resource_class.properties[:custom_property].desired_state?).to be_truthy expect(resource_class.state_properties).to eq [ - resource_class.properties[:custom_property] + resource_class.properties[:custom_property], ] end it "identity_properties does not change custom_property's getter or setter" do @@ -393,7 +393,7 @@ describe "Chef::Resource#identity and #state" do expect(resource_class.properties[:x].desired_state?).to be_truthy expect(resource_class.state_properties).to eq [ - resource_class.properties[:x] + resource_class.properties[:x], ] expect(resource.state_for_resource_reporter).to eq(x: 10) end @@ -430,11 +430,11 @@ describe "Chef::Resource#identity and #state" do expect(resource_class.properties[:x].desired_state?).to be_truthy expect(resource_class.properties[:x].identity?).to be_truthy expect(resource_class.identity_properties).to eq [ - resource_class.properties[:x] + resource_class.properties[:x], ] expect(resource.identity).to eq(10) expect(resource_class.state_properties).to eq [ - resource_class.properties[:x] + resource_class.properties[:x], ] expect(resource.state_for_resource_reporter).to eq(x: 10) end @@ -448,7 +448,7 @@ describe "Chef::Resource#identity and #state" do expect(resource_class.properties[:x].desired_state?).to be_falsey expect(resource_class.properties[:y].desired_state?).to be_truthy expect(resource_class.state_properties).to eq [ - resource_class.properties[:y] + resource_class.properties[:y], ] expect(resource.state_for_resource_reporter).to eq(y: 20) end @@ -474,11 +474,11 @@ describe "Chef::Resource#identity and #state" do expect(subresource_class.properties[:x].desired_state?).to be_truthy expect(subresource_class.properties[:x].identity?).to be_truthy expect(subresource_class.identity_properties).to eq [ - subresource_class.properties[:x] + subresource_class.properties[:x], ] expect(subresource.identity).to eq(10) expect(subresource_class.state_properties).to eq [ - subresource_class.properties[:x] + subresource_class.properties[:x], ] expect(subresource.state_for_resource_reporter).to eq(x: 10) end @@ -491,13 +491,13 @@ describe "Chef::Resource#identity and #state" do expect(subresource_class.properties[:x].object_id).to eq old_value.object_id expect(subresource_class.properties[:y].desired_state?).to be_truthy expect(subresource_class.state_properties).to eq [ - subresource_class.properties[:y] + subresource_class.properties[:y], ] expect(subresource.state_for_resource_reporter).to eq(y: 20) expect(subresource_class.properties[:x].identity?).to be_truthy expect(subresource_class.identity_properties).to eq [ - subresource_class.properties[:x] + subresource_class.properties[:x], ] expect(subresource.identity).to eq(10) end diff --git a/spec/unit/provider/group/groupadd_spec.rb b/spec/unit/provider/group/groupadd_spec.rb index 87ab3c3493..93159dd16e 100644 --- a/spec/unit/provider/group/groupadd_spec.rb +++ b/spec/unit/provider/group/groupadd_spec.rb @@ -38,7 +38,7 @@ describe Chef::Provider::Group::Groupadd, "set_options" do end field_list = { - :gid => "-g" + :gid => "-g", } field_list.each do |attribute, option| diff --git a/spec/unit/provider/launchd_spec.rb b/spec/unit/provider/launchd_spec.rb index d88783b1f6..0a382dcb93 100644 --- a/spec/unit/provider/launchd_spec.rb +++ b/spec/unit/provider/launchd_spec.rb @@ -58,7 +58,7 @@ XML "Hourly" => 10, "Weekday" => 7, }, - "TimeOut" => 300 + "TimeOut" => 300, } end before(:each) do diff --git a/spec/unit/provider/ohai_spec.rb b/spec/unit/provider/ohai_spec.rb index 100eee59a4..fad08ba589 100644 --- a/spec/unit/provider/ohai_spec.rb +++ b/spec/unit/provider/ohai_spec.rb @@ -34,7 +34,7 @@ describe Chef::Provider::Ohai do :platform => @platform, :platform_version => @platform_version, :data => { - :origdata => "somevalue" + :origdata => "somevalue", }, :data2 => { :origdata => "somevalue", diff --git a/spec/unit/provider/osx_profile_spec.rb b/spec/unit/provider/osx_profile_spec.rb index f11fce49db..6c997fbb4c 100644 --- a/spec/unit/provider/osx_profile_spec.rb +++ b/spec/unit/provider/osx_profile_spec.rb @@ -58,7 +58,7 @@ describe Chef::Provider::OsxProfile do "ProfileType" => "Configuration", "ProfileUUID" => "6e95927c-f200-54b4-85c7-52ab99b61c47", "ProfileVerificationState" => "unsigned", - "ProfileVersion" => 1 }] + "ProfileVersion" => 1 }], } end # If anything is changed within this profile, be sure to update the @@ -86,11 +86,11 @@ describe Chef::Provider::OsxProfile do "Forced" => [ { "mcx_preference_settings" => { - "idleTime" => 0 - } + "idleTime" => 0, + }, }, - ] - } + ], + }, }, }, ], @@ -131,7 +131,7 @@ describe Chef::Provider::OsxProfile do new_resource.profile test_profile provider.load_current_resource expect( - provider.instance_variable_get(:@new_profile_identifier) + provider.instance_variable_get(:@new_profile_identifier), ).to eql(test_profile["PayloadIdentifier"]) end @@ -214,7 +214,7 @@ describe Chef::Provider::OsxProfile do "ProfileType" => "Configuration", "ProfileUUID" => "1781fbec-3325-565f-9022-8aa28135c3cc", "ProfileVerificationState" => "unsigned", - "ProfileVersion" => 1 }] + "ProfileVersion" => 1 }], } end before(:each) do @@ -226,7 +226,7 @@ describe Chef::Provider::OsxProfile do new_resource.profile_name "com.testprofile.screensaver" new_resource.action(:remove) provider.load_current_resource - expect(provider.instance_variable_get(:@new_profile_identifier) + expect(provider.instance_variable_get(:@new_profile_identifier), ).to eql(new_resource.profile_name) end @@ -234,7 +234,7 @@ describe Chef::Provider::OsxProfile do new_resource.identifier "com.testprofile.screensaver" new_resource.action(:remove) provider.load_current_resource - expect(provider.instance_variable_get(:@new_profile_identifier) + expect(provider.instance_variable_get(:@new_profile_identifier), ).to eql(new_resource.identifier) end diff --git a/spec/unit/provider/package/chocolatey_spec.rb b/spec/unit/provider/package/chocolatey_spec.rb index a347aa7ebd..37b3ef8ccb 100644 --- a/spec/unit/provider/package/chocolatey_spec.rb +++ b/spec/unit/provider/package/chocolatey_spec.rb @@ -132,7 +132,7 @@ munin-node|1.6.1.20130823 it "should load and downcase names in the installed_packages hash" do provider.load_current_resource expect(provider.send(:installed_packages)).to eql( - { "chocolatey" => "0.9.9.11", "conemu" => "15.10.25.0" } + { "chocolatey" => "0.9.9.11", "conemu" => "15.10.25.0" }, ) end @@ -140,7 +140,7 @@ munin-node|1.6.1.20130823 allow_remote_list(["git"]) provider.load_current_resource expect(provider.send(:available_packages)).to eql( - { "chocolatey" => "0.9.9.11", "conemu" => "15.10.25.1", "git" => "2.6.2", "munin-node" => "1.6.1.20130823" } + { "chocolatey" => "0.9.9.11", "conemu" => "15.10.25.1", "git" => "2.6.2", "munin-node" => "1.6.1.20130823" }, ) end diff --git a/spec/unit/provider/package/dpkg_spec.rb b/spec/unit/provider/package/dpkg_spec.rb index 613f7a326e..0d651b238a 100644 --- a/spec/unit/provider/package/dpkg_spec.rb +++ b/spec/unit/provider/package/dpkg_spec.rb @@ -199,7 +199,7 @@ Section: ruby it "and we should raise if we get any other exit codes from dpkg -s" do dpkg_s_status = double( - exitstatus: 3, stderr: "i am very, very angry with you. i'm very, very cross. go to your room.", stdout: "" + exitstatus: 3, stderr: "i am very, very angry with you. i'm very, very cross. go to your room.", stdout: "", ) expect(provider).to receive(:shell_out!).with("dpkg -s #{package}", returns: [0, 1], timeout: 900).and_raise(Mixlib::ShellOut::ShellCommandFailed) expect { provider.load_current_resource }.to raise_error(Mixlib::ShellOut::ShellCommandFailed) diff --git a/spec/unit/provider/package/easy_install_spec.rb b/spec/unit/provider/package/easy_install_spec.rb index 8ce485648b..681365b98b 100644 --- a/spec/unit/provider/package/easy_install_spec.rb +++ b/spec/unit/provider/package/easy_install_spec.rb @@ -62,14 +62,14 @@ describe Chef::Provider::Package::EasyInstall do describe "actions_on_package" do it "should run easy_install with the package name and version" do expect(@provider).to receive(:run_command).with({ - :command => "easy_install \"boto==1.8d\"" + :command => "easy_install \"boto==1.8d\"", },) @provider.install_package("boto", "1.8d") end it "should run easy_install with the package name and version and specified options" do expect(@provider).to receive(:run_command).with({ - :command => "easy_install --always-unzip \"boto==1.8d\"" + :command => "easy_install --always-unzip \"boto==1.8d\"", },) allow(@new_resource).to receive(:options).and_return("--always-unzip") @provider.install_package("boto", "1.8d") @@ -77,21 +77,21 @@ describe Chef::Provider::Package::EasyInstall do it "should run easy_install with the package name and version" do expect(@provider).to receive(:run_command).with({ - :command => "easy_install \"boto==1.8d\"" + :command => "easy_install \"boto==1.8d\"", },) @provider.upgrade_package("boto", "1.8d") end it "should run easy_install -m with the package name and version" do expect(@provider).to receive(:run_command).with({ - :command => "easy_install -m boto" + :command => "easy_install -m boto", },) @provider.remove_package("boto", "1.8d") end it "should run easy_install -m with the package name and version and specified options" do expect(@provider).to receive(:run_command).with({ - :command => "easy_install -x -m boto" + :command => "easy_install -x -m boto", },) allow(@new_resource).to receive(:options).and_return("-x") @provider.remove_package("boto", "1.8d") @@ -99,7 +99,7 @@ describe Chef::Provider::Package::EasyInstall do it "should run easy_install -m with the package name and version" do expect(@provider).to receive(:run_command).with({ - :command => "easy_install -m boto" + :command => "easy_install -m boto", },) @provider.purge_package("boto", "1.8d") end diff --git a/spec/unit/provider/package/openbsd_spec.rb b/spec/unit/provider/package/openbsd_spec.rb index 3e1c1c90b6..48802f48ce 100644 --- a/spec/unit/provider/package/openbsd_spec.rb +++ b/spec/unit/provider/package/openbsd_spec.rb @@ -56,7 +56,7 @@ describe Chef::Provider::Package::Openbsd do instance_double("shellout", :stdout => "#{name}-#{version}\n")) expect(provider).to receive(:shell_out!).with( "pkg_add -r #{name}-#{version}", - { :env => { "PKG_PATH" => "http://ftp.OpenBSD.org/pub/OpenBSD/5.5/packages/amd64/" }, timeout: 900 } + { :env => { "PKG_PATH" => "http://ftp.OpenBSD.org/pub/OpenBSD/5.5/packages/amd64/" }, timeout: 900 }, ) { OpenStruct.new :status => true } provider.run_action(:install) end @@ -88,7 +88,7 @@ describe Chef::Provider::Package::Openbsd do instance_double("shellout", :stdout => "#{name}-#{version}-#{flavor}\n")) expect(provider).to receive(:shell_out!).with( "pkg_add -r #{name}-#{version}-#{flavor}", - { env: { "PKG_PATH" => "http://ftp.OpenBSD.org/pub/OpenBSD/5.5/packages/amd64/" }, timeout: 900 } + { env: { "PKG_PATH" => "http://ftp.OpenBSD.org/pub/OpenBSD/5.5/packages/amd64/" }, timeout: 900 }, ) { OpenStruct.new :status => true } provider.run_action(:install) end @@ -104,7 +104,7 @@ describe Chef::Provider::Package::Openbsd do new_resource.version("#{version}-#{flavor_b}") expect(provider).to receive(:shell_out!).with( "pkg_add -r #{name}-#{version}-#{flavor_b}", - { env: { "PKG_PATH" => "http://ftp.OpenBSD.org/pub/OpenBSD/5.5/packages/amd64/" }, timeout: 900 } + { env: { "PKG_PATH" => "http://ftp.OpenBSD.org/pub/OpenBSD/5.5/packages/amd64/" }, timeout: 900 }, ) { OpenStruct.new :status => true } provider.run_action(:install) end diff --git a/spec/unit/provider/package/yum_spec.rb b/spec/unit/provider/package/yum_spec.rb index 2b3048bc19..bb071a6559 100644 --- a/spec/unit/provider/package/yum_spec.rb +++ b/spec/unit/provider/package/yum_spec.rb @@ -133,7 +133,7 @@ describe Chef::Provider::Package::Yum do it "should set the arch if no existing package_name is found and new_package_name+new_arch is available" do @new_resource = Chef::Resource::YumPackage.new("testing.noarch") @yum_cache = double( - "Chef::Provider::Yum::YumCache" + "Chef::Provider::Yum::YumCache", ) allow(@yum_cache).to receive(:installed_version) do |package_name, arch| # nothing installed for package_name/new_package_name @@ -188,7 +188,7 @@ describe Chef::Provider::Package::Yum do it "should not set the arch when an existing package_name is found" do @new_resource = Chef::Resource::YumPackage.new("testing.beta3") @yum_cache = double( - "Chef::Provider::Yum::YumCache" + "Chef::Provider::Yum::YumCache", ) allow(@yum_cache).to receive(:installed_version) do |package_name, arch| # installed for package_name @@ -224,7 +224,7 @@ describe Chef::Provider::Package::Yum do it "should not set the arch when no existing package_name or new_package_name+new_arch is found" do @new_resource = Chef::Resource::YumPackage.new("testing.beta3") @yum_cache = double( - "Chef::Provider::Yum::YumCache" + "Chef::Provider::Yum::YumCache", ) allow(@yum_cache).to receive(:installed_version) do |package_name, arch| # nothing installed for package_name/new_package_name @@ -256,7 +256,7 @@ describe Chef::Provider::Package::Yum do @new_resource = Chef::Resource::YumPackage.new("testing.i386") @new_resource.arch("x86_64") @yum_cache = double( - "Chef::Provider::Yum::YumCache" + "Chef::Provider::Yum::YumCache", ) allow(@yum_cache).to receive(:installed_version) do |package_name, arch| # nothing installed for package_name/new_package_name @@ -524,7 +524,7 @@ describe Chef::Provider::Package::Yum do @provider.load_current_resource allow(Chef::Provider::Package::Yum::RPMUtils).to receive(:rpmvercmp).and_return(-1) expect(@provider).to receive(:yum_command).with( - "-d0 -e0 -y install cups-1.2.4-11.19.el5" + "-d0 -e0 -y install cups-1.2.4-11.19.el5", ) @provider.install_package("cups", "1.2.4-11.19.el5") end @@ -532,7 +532,7 @@ describe Chef::Provider::Package::Yum do it "should run yum localinstall if given a path to an rpm" do allow(@new_resource).to receive(:source).and_return("/tmp/emacs-21.4-20.el5.i386.rpm") expect(@provider).to receive(:yum_command).with( - "-d0 -e0 -y localinstall /tmp/emacs-21.4-20.el5.i386.rpm" + "-d0 -e0 -y localinstall /tmp/emacs-21.4-20.el5.i386.rpm", ) @provider.install_package("emacs", "21.4-20.el5") end @@ -543,7 +543,7 @@ describe Chef::Provider::Package::Yum do @provider = Chef::Provider::Package::Yum.new(@new_resource, @run_context) expect(@new_resource.source).to eq("/tmp/emacs-21.4-20.el5.i386.rpm") expect(@provider).to receive(:yum_command).with( - "-d0 -e0 -y localinstall /tmp/emacs-21.4-20.el5.i386.rpm" + "-d0 -e0 -y localinstall /tmp/emacs-21.4-20.el5.i386.rpm", ) @provider.install_package("/tmp/emacs-21.4-20.el5.i386.rpm", "21.4-20.el5") end @@ -553,7 +553,7 @@ describe Chef::Provider::Package::Yum do allow(@new_resource).to receive(:arch).and_return("i386") allow(Chef::Provider::Package::Yum::RPMUtils).to receive(:rpmvercmp).and_return(-1) expect(@provider).to receive(:yum_command).with( - "-d0 -e0 -y install cups-1.2.4-11.19.el5.i386" + "-d0 -e0 -y install cups-1.2.4-11.19.el5.i386", ) @provider.install_package("cups", "1.2.4-11.19.el5") end @@ -564,7 +564,7 @@ describe Chef::Provider::Package::Yum do allow(@new_resource).to receive(:options).and_return("--disablerepo epmd") allow(Chef::Provider::Package::Yum::RPMUtils).to receive(:rpmvercmp).and_return(-1) expect(@provider).to receive(:yum_command).with( - "-d0 -e0 -y --disablerepo epmd install cups-11" + "-d0 -e0 -y --disablerepo epmd install cups-11", ) @provider.install_package(@new_resource.name, @provider.candidate_version) end @@ -624,7 +624,7 @@ describe Chef::Provider::Package::Yum do @provider = Chef::Provider::Package::Yum.new(@new_resource, @run_context) @provider.load_current_resource expect(@provider).to receive(:yum_command).with( - "-d0 -e0 -y install cups-1.2.4-11.15.el5" + "-d0 -e0 -y install cups-1.2.4-11.15.el5", ) @provider.install_package("cups", "1.2.4-11.15.el5") end @@ -648,7 +648,7 @@ describe Chef::Provider::Package::Yum do @provider = Chef::Provider::Package::Yum.new(@new_resource, @run_context) @provider.load_current_resource expect(@provider).to receive(:yum_command).with( - "-d0 -e0 -y downgrade cups-1.2.4-11.15.el5" + "-d0 -e0 -y downgrade cups-1.2.4-11.15.el5", ) @provider.install_package("cups", "1.2.4-11.15.el5") end @@ -658,7 +658,7 @@ describe Chef::Provider::Package::Yum do @provider.load_current_resource allow(Chef::Provider::Package::Yum::RPMUtils).to receive(:rpmvercmp).and_return(-1) expect(@provider).to receive(:yum_command).with( - "-d0 -e0 -y install cups-1.2.4-11.15.el5" + "-d0 -e0 -y install cups-1.2.4-11.15.el5", ) expect(@yum_cache).to receive(:reload).once @provider.install_package("cups", "1.2.4-11.15.el5") @@ -669,7 +669,7 @@ describe Chef::Provider::Package::Yum do @provider.load_current_resource allow(Chef::Provider::Package::Yum::RPMUtils).to receive(:rpmvercmp).and_return(-1) expect(@provider).to receive(:yum_command).with( - "-d0 -e0 -y install cups-1.2.4-11.15.el5" + "-d0 -e0 -y install cups-1.2.4-11.15.el5", ) expect(@yum_cache).not_to receive(:reload) @provider.install_package("cups", "1.2.4-11.15.el5") @@ -682,7 +682,7 @@ describe Chef::Provider::Package::Yum do allow(@provider).to receive(:candidate_version).and_return("11") allow(Chef::Provider::Package::Yum::RPMUtils).to receive(:rpmvercmp).and_return(-1) expect(@provider).to receive(:yum_command).with( - "-d0 -e0 -y install cups-11" + "-d0 -e0 -y install cups-11", ) @provider.upgrade_package(@new_resource.name, @provider.candidate_version) end @@ -693,7 +693,7 @@ describe Chef::Provider::Package::Yum do allow(@provider).to receive(:candidate_version).and_return("11") allow(Chef::Provider::Package::Yum::RPMUtils).to receive(:rpmvercmp).and_return(-1) expect(@provider).to receive(:yum_command).with( - "-d0 -e0 -y install cups-11" + "-d0 -e0 -y install cups-11", ) @provider.upgrade_package(@new_resource.name, @provider.candidate_version) end @@ -761,7 +761,7 @@ describe Chef::Provider::Package::Yum do describe "when removing a package" do it "should run yum remove with the package name" do expect(@provider).to receive(:yum_command).with( - "-d0 -e0 -y remove emacs-1.0" + "-d0 -e0 -y remove emacs-1.0", ) @provider.remove_package("emacs", "1.0") end @@ -769,7 +769,7 @@ describe Chef::Provider::Package::Yum do it "should run yum remove with the package name and arch" do allow(@new_resource).to receive(:arch).and_return("x86_64") expect(@provider).to receive(:yum_command).with( - "-d0 -e0 -y remove emacs-1.0.x86_64" + "-d0 -e0 -y remove emacs-1.0.x86_64", ) @provider.remove_package("emacs", "1.0") end @@ -778,7 +778,7 @@ describe Chef::Provider::Package::Yum do describe "when purging a package" do it "should run yum remove with the package name" do expect(@provider).to receive(:yum_command).with( - "-d0 -e0 -y remove emacs-1.0" + "-d0 -e0 -y remove emacs-1.0", ) @provider.purge_package("emacs", "1.0") end @@ -2211,7 +2211,7 @@ describe "Chef::Provider::Package::Yum - Multi" do allow(@yum_cache).to receive(:installed_version).with("cups", nil).and_return("1.2.4-11.18.el5") allow(@yum_cache).to receive(:installed_version).with("vim", nil).and_return("0.9") expect(@provider).to receive(:yum_command).with( - "-d0 -e0 -y install cups-1.2.4-11.19.el5 vim-1.0" + "-d0 -e0 -y install cups-1.2.4-11.19.el5 vim-1.0", ) @provider.install_package(%w{cups vim}, ["1.2.4-11.19.el5", "1.0"]) end @@ -2221,7 +2221,7 @@ describe "Chef::Provider::Package::Yum - Multi" do allow(@new_resource).to receive(:arch).and_return("i386") allow(Chef::Provider::Package::Yum::RPMUtils).to receive(:rpmvercmp).and_return(-1) expect(@provider).to receive(:yum_command).with( - "-d0 -e0 -y install cups-1.2.4-11.19.el5.i386 vim-1.0.i386" + "-d0 -e0 -y install cups-1.2.4-11.19.el5.i386 vim-1.0.i386", ) @provider.install_package(%w{cups vim}, ["1.2.4-11.19.el5", "1.0"]) end @@ -2232,7 +2232,7 @@ describe "Chef::Provider::Package::Yum - Multi" do allow(@yum_cache).to receive(:installed_version).with("cups", nil).and_return("1.2.4-11.18.el5") allow(@yum_cache).to receive(:installed_version).with("vim", nil).and_return("0.9") expect(@provider).to receive(:yum_command).with( - "-d0 -e0 -y --disablerepo epmd install cups-1.2.4-11.19.el5 vim-1.0" + "-d0 -e0 -y --disablerepo epmd install cups-1.2.4-11.19.el5 vim-1.0", ) allow(@new_resource).to receive(:options).and_return("--disablerepo epmd") @provider.install_package(%w{cups vim}, ["1.2.4-11.19.el5", "1.0"]) @@ -2258,7 +2258,7 @@ describe "Chef::Provider::Package::Yum - Multi" do @provider.load_current_resource expect(@provider).to receive(:yum_command).with( - "-d0 -e0 -y install cups-1.2.4-11.19.el5.x86_64 vim-1.0" + "-d0 -e0 -y install cups-1.2.4-11.19.el5.x86_64 vim-1.0", ) @provider.install_package(%w{cups vim}, ["1.2.4-11.19.el5", "1.0"]) end diff --git a/spec/unit/provider/package/zypper_spec.rb b/spec/unit/provider/package/zypper_spec.rb index df0a1da9a2..4def0f5558 100644 --- a/spec/unit/provider/package/zypper_spec.rb +++ b/spec/unit/provider/package/zypper_spec.rb @@ -61,7 +61,7 @@ describe Chef::Provider::Package::Zypper do it "should run zypper info with the package name" do shell_out_expectation!( - "zypper --non-interactive info #{new_resource.package_name}" + "zypper --non-interactive info #{new_resource.package_name}", ).and_return(status) provider.load_current_resource end @@ -97,23 +97,23 @@ describe Chef::Provider::Package::Zypper do it "should run zypper install with the package name and version" do allow(Chef::Config).to receive(:[]).with(:zypper_check_gpg).and_return(true) shell_out_expectation!( - "zypper --non-interactive install --auto-agree-with-licenses emacs=1.0" + "zypper --non-interactive install --auto-agree-with-licenses emacs=1.0", ) provider.install_package(["emacs"], ["1.0"]) end it "should run zypper install without gpg checks" do allow(Chef::Config).to receive(:[]).with(:zypper_check_gpg).and_return(false) shell_out_expectation!( - "zypper --non-interactive --no-gpg-checks install " + "--auto-agree-with-licenses emacs=1.0" + "zypper --non-interactive --no-gpg-checks install " + "--auto-agree-with-licenses emacs=1.0", ) provider.install_package(["emacs"], ["1.0"]) end it "should warn about gpg checks on zypper install" do expect(Chef::Log).to receive(:warn).with( - /All packages will be installed without gpg signature checks/ + /All packages will be installed without gpg signature checks/, ) shell_out_expectation!( - "zypper --non-interactive --no-gpg-checks install " + "--auto-agree-with-licenses emacs=1.0" + "zypper --non-interactive --no-gpg-checks install " + "--auto-agree-with-licenses emacs=1.0", ) provider.install_package(["emacs"], ["1.0"]) end @@ -123,29 +123,29 @@ describe Chef::Provider::Package::Zypper do it "should run zypper update with the package name and version" do allow(Chef::Config).to receive(:[]).with(:zypper_check_gpg).and_return(true) shell_out_expectation!( - "zypper --non-interactive install --auto-agree-with-licenses emacs=1.0" + "zypper --non-interactive install --auto-agree-with-licenses emacs=1.0", ) provider.upgrade_package(["emacs"], ["1.0"]) end it "should run zypper update without gpg checks" do allow(Chef::Config).to receive(:[]).with(:zypper_check_gpg).and_return(false) shell_out_expectation!( - "zypper --non-interactive --no-gpg-checks install " + "--auto-agree-with-licenses emacs=1.0" + "zypper --non-interactive --no-gpg-checks install " + "--auto-agree-with-licenses emacs=1.0", ) provider.upgrade_package(["emacs"], ["1.0"]) end it "should warn about gpg checks on zypper upgrade" do expect(Chef::Log).to receive(:warn).with( - /All packages will be installed without gpg signature checks/ + /All packages will be installed without gpg signature checks/, ) shell_out_expectation!( - "zypper --non-interactive --no-gpg-checks install " + "--auto-agree-with-licenses emacs=1.0" + "zypper --non-interactive --no-gpg-checks install " + "--auto-agree-with-licenses emacs=1.0", ) provider.upgrade_package(["emacs"], ["1.0"]) end it "should run zypper upgrade without gpg checks" do shell_out_expectation!( - "zypper --non-interactive --no-gpg-checks install " + "--auto-agree-with-licenses emacs=1.0" + "zypper --non-interactive --no-gpg-checks install " + "--auto-agree-with-licenses emacs=1.0", ) provider.upgrade_package(["emacs"], ["1.0"]) end @@ -157,7 +157,7 @@ describe Chef::Provider::Package::Zypper do it "should run zypper remove with the package name" do allow(Chef::Config).to receive(:[]).with(:zypper_check_gpg).and_return(true) shell_out_expectation!( - "zypper --non-interactive remove emacs" + "zypper --non-interactive remove emacs", ) provider.remove_package(["emacs"], [nil]) end @@ -167,23 +167,23 @@ describe Chef::Provider::Package::Zypper do it "should run zypper remove with the package name" do allow(Chef::Config).to receive(:[]).with(:zypper_check_gpg).and_return(true) shell_out_expectation!( - "zypper --non-interactive remove emacs=1.0" + "zypper --non-interactive remove emacs=1.0", ) provider.remove_package(["emacs"], ["1.0"]) end it "should run zypper remove without gpg checks" do allow(Chef::Config).to receive(:[]).with(:zypper_check_gpg).and_return(false) shell_out_expectation!( - "zypper --non-interactive --no-gpg-checks remove emacs=1.0" + "zypper --non-interactive --no-gpg-checks remove emacs=1.0", ) provider.remove_package(["emacs"], ["1.0"]) end it "should warn about gpg checks on zypper remove" do expect(Chef::Log).to receive(:warn).with( - /All packages will be installed without gpg signature checks/ + /All packages will be installed without gpg signature checks/, ) shell_out_expectation!( - "zypper --non-interactive --no-gpg-checks remove emacs=1.0" + "zypper --non-interactive --no-gpg-checks remove emacs=1.0", ) provider.remove_package(["emacs"], ["1.0"]) end @@ -193,23 +193,23 @@ describe Chef::Provider::Package::Zypper do describe "purge_package" do it "should run remove with the name and version and --clean-deps" do shell_out_expectation!( - "zypper --non-interactive --no-gpg-checks remove --clean-deps emacs=1.0" + "zypper --non-interactive --no-gpg-checks remove --clean-deps emacs=1.0", ) provider.purge_package(["emacs"], ["1.0"]) end it "should run zypper purge without gpg checks" do allow(Chef::Config).to receive(:[]).with(:zypper_check_gpg).and_return(false) shell_out_expectation!( - "zypper --non-interactive --no-gpg-checks remove --clean-deps emacs=1.0" + "zypper --non-interactive --no-gpg-checks remove --clean-deps emacs=1.0", ) provider.purge_package(["emacs"], ["1.0"]) end it "should warn about gpg checks on zypper purge" do expect(Chef::Log).to receive(:warn).with( - /All packages will be installed without gpg signature checks/ + /All packages will be installed without gpg signature checks/, ) shell_out_expectation!( - "zypper --non-interactive --no-gpg-checks remove --clean-deps emacs=1.0" + "zypper --non-interactive --no-gpg-checks remove --clean-deps emacs=1.0", ) provider.purge_package(["emacs"], ["1.0"]) end @@ -223,7 +223,7 @@ describe Chef::Provider::Package::Zypper do describe "install_package" do it "should run zypper install with the package name and version" do shell_out_expectation!( - "zypper --no-gpg-checks install --auto-agree-with-licenses -y emacs" + "zypper --no-gpg-checks install --auto-agree-with-licenses -y emacs", ) provider.install_package(["emacs"], ["1.0"]) end @@ -232,7 +232,7 @@ describe Chef::Provider::Package::Zypper do describe "upgrade_package" do it "should run zypper update with the package name and version" do shell_out_expectation!( - "zypper --no-gpg-checks install --auto-agree-with-licenses -y emacs" + "zypper --no-gpg-checks install --auto-agree-with-licenses -y emacs", ) provider.upgrade_package(["emacs"], ["1.0"]) end @@ -241,7 +241,7 @@ describe Chef::Provider::Package::Zypper do describe "remove_package" do it "should run zypper remove with the package name" do shell_out_expectation!( - "zypper --no-gpg-checks remove -y emacs" + "zypper --no-gpg-checks remove -y emacs", ) provider.remove_package(["emacs"], ["1.0"]) end @@ -252,7 +252,7 @@ describe Chef::Provider::Package::Zypper do it "should install an array of package names and versions" do allow(Chef::Config).to receive(:[]).with(:zypper_check_gpg).and_return(false) shell_out_expectation!( - "zypper --non-interactive --no-gpg-checks install " + "--auto-agree-with-licenses emacs=1.0 vim=2.0" + "zypper --non-interactive --no-gpg-checks install " + "--auto-agree-with-licenses emacs=1.0 vim=2.0", ) provider.install_package(%w{emacs vim}, ["1.0", "2.0"]) end @@ -260,7 +260,7 @@ describe Chef::Provider::Package::Zypper do it "should remove an array of package names and versions" do allow(Chef::Config).to receive(:[]).with(:zypper_check_gpg).and_return(false) shell_out_expectation!( - "zypper --non-interactive --no-gpg-checks remove emacs=1.0 vim=2.0" + "zypper --non-interactive --no-gpg-checks remove emacs=1.0 vim=2.0", ) provider.remove_package(%w{emacs vim}, ["1.0", "2.0"]) end diff --git a/spec/unit/provider/package_spec.rb b/spec/unit/provider/package_spec.rb index 9f2b019a84..d0d20a4372 100644 --- a/spec/unit/provider/package_spec.rb +++ b/spec/unit/provider/package_spec.rb @@ -62,7 +62,7 @@ describe Chef::Provider::Package do ).and_return("/var/cache/preseed-test") expect(provider).to receive(:preseed_package).with( - "/var/cache/preseed-test" + "/var/cache/preseed-test", ).and_return(true) provider.run_action(:install) end diff --git a/spec/unit/provider_resolver_spec.rb b/spec/unit/provider_resolver_spec.rb index 3ac7da5880..f85c46c836 100644 --- a/spec/unit/provider_resolver_spec.rb +++ b/spec/unit/provider_resolver_spec.rb @@ -259,7 +259,7 @@ describe Chef::ProviderResolver do Chef::Provider::Service::Invokercd, ) expect(provider_resolver.supported_handlers).to_not include( - Chef::Provider::Service::Upstart + Chef::Provider::Service::Upstart, ) end @@ -314,7 +314,7 @@ describe Chef::ProviderResolver do it "supports only the upstart handler" do expect(provider_resolver.supported_handlers).to include( - Chef::Provider::Service::Upstart + Chef::Provider::Service::Upstart, ) expect(provider_resolver.supported_handlers).to_not include( Chef::Provider::Service::Debian, @@ -591,35 +591,35 @@ describe Chef::ProviderResolver do # service: [ Chef::Resource::InsservService, Chef::Provider::Service::Insserv ], }, "5.0" => { - ifconfig: [ Chef::Resource::Ifconfig, Chef::Provider::Ifconfig ] + ifconfig: [ Chef::Resource::Ifconfig, Chef::Provider::Ifconfig ], }, }, "gcel" => { "3.1.4" => { - ifconfig: [ Chef::Resource::Ifconfig, Chef::Provider::Ifconfig ] - } + ifconfig: [ Chef::Resource::Ifconfig, Chef::Provider::Ifconfig ], + }, }, "linaro" => { "3.1.4" => { - ifconfig: [ Chef::Resource::Ifconfig, Chef::Provider::Ifconfig ] - } + ifconfig: [ Chef::Resource::Ifconfig, Chef::Provider::Ifconfig ], + }, }, "linuxmint" => { "3.1.4" => { ifconfig: [ Chef::Resource::Ifconfig, Chef::Provider::Ifconfig ], # service: [ Chef::Resource::UpstartService, Chef::Provider::Service::Upstart ], - } + }, }, "raspbian" => { "3.1.4" => { - ifconfig: [ Chef::Resource::Ifconfig, Chef::Provider::Ifconfig ] - } + ifconfig: [ Chef::Resource::Ifconfig, Chef::Provider::Ifconfig ], + }, }, "ubuntu" => { "11.10" => { }, "10.04" => { - ifconfig: [ Chef::Resource::Ifconfig, Chef::Provider::Ifconfig ] + ifconfig: [ Chef::Resource::Ifconfig, Chef::Provider::Ifconfig ], }, }, }, @@ -630,7 +630,7 @@ describe Chef::ProviderResolver do "arch" => { "3.1.4" => { - } + }, }, }, @@ -640,7 +640,7 @@ describe Chef::ProviderResolver do "freebsd" => { "3.1.4" => { - } + }, }, }, "suse" => { @@ -649,7 +649,7 @@ describe Chef::ProviderResolver do "12.0" => { }, %w{11.1 11.2 11.3} => { - group: [ Chef::Resource::Group, Chef::Provider::Group::Suse ] + group: [ Chef::Resource::Group, Chef::Provider::Group::Suse ], }, }, "opensuse" => { @@ -659,7 +659,7 @@ describe Chef::ProviderResolver do "12.3" => { }, "12.2" => { - group: [ Chef::Resource::Group, Chef::Provider::Group::Suse ] + group: [ Chef::Resource::Group, Chef::Provider::Group::Suse ], }, }, }, @@ -672,7 +672,7 @@ describe Chef::ProviderResolver do "gentoo" => { "3.1.4" => { - } + }, }, }, @@ -684,7 +684,7 @@ describe Chef::ProviderResolver do %w{amazon xcp xenserver ibm_powerkvm cloudlinux parallels} => { "3.1.4" => { # service: [ Chef::Resource::RedhatService, Chef::Provider::Service::Redhat ], - } + }, }, %w{redhat centos scientific oracle} => { "7.0" => { @@ -713,9 +713,9 @@ describe Chef::ProviderResolver do "mac_os_x" => { "10.9.2" => { - } + }, }, - } + }, }, "windows" => { @@ -734,8 +734,8 @@ describe Chef::ProviderResolver do "windows" => { %w{mswin mingw32 windows} => { "10.9.2" => { - } - } + }, + }, }, }, @@ -754,8 +754,8 @@ describe Chef::ProviderResolver do "aix" => { "aix" => { "5.6" => { - } - } + }, + }, }, }, @@ -763,20 +763,20 @@ describe Chef::ProviderResolver do "hpux" => { "hpux" => { "3.1.4" => { - group: [ Chef::Resource::Group, Chef::Provider::Group::Usermod ] - } - } - } + group: [ Chef::Resource::Group, Chef::Provider::Group::Usermod ], + }, + }, + }, }, "netbsd" => { "netbsd" => { "netbsd" => { "3.1.4" => { - group: [ Chef::Resource::Group, Chef::Provider::Group::Groupmod ] - } - } - } + group: [ Chef::Resource::Group, Chef::Provider::Group::Groupmod ], + }, + }, + }, }, "openbsd" => { @@ -786,8 +786,8 @@ describe Chef::ProviderResolver do "openbsd" => { "openbsd" => { "3.1.4" => { - } - } + }, + }, }, }, @@ -804,32 +804,32 @@ describe Chef::ProviderResolver do "smartos" => { "3.1.4" => { - } + }, }, }, "solaris2" => { "nexentacore" => { "3.1.4" => { - } + }, }, "omnios" => { "3.1.4" => { - user: [ Chef::Resource::User, Chef::Provider::User::Solaris ] - } + user: [ Chef::Resource::User, Chef::Provider::User::Solaris ], + }, }, "openindiana" => { "3.1.4" => { - } + }, }, "opensolaris" => { "3.1.4" => { - } + }, }, "solaris2" => { user: [ Chef::Resource::User, Chef::Provider::User::Solaris ], "5.11" => { - package: [ Chef::Resource::IpsPackage, Chef::Provider::Package::Ips ] + package: [ Chef::Resource::IpsPackage, Chef::Provider::Package::Ips ], }, "5.9" => { }, @@ -842,9 +842,9 @@ describe Chef::ProviderResolver do "solaris" => { "solaris" => { "3.1.4" => { - } - } - } + }, + }, + }, }, "exherbo" => { @@ -852,10 +852,10 @@ describe Chef::ProviderResolver do "exherbo" => { "3.1.4" => { # TODO should be Chef::Resource::PaludisPackage - package: [ Chef::Resource::Package, Chef::Provider::Package::Paludis ] - } - } - } + package: [ Chef::Resource::Package, Chef::Provider::Package::Paludis ], + }, + }, + }, }, } diff --git a/spec/unit/resource/launchd_spec.rb b/spec/unit/resource/launchd_spec.rb index 95febc47cf..8843ec606d 100644 --- a/spec/unit/resource/launchd_spec.rb +++ b/spec/unit/resource/launchd_spec.rb @@ -6,7 +6,7 @@ describe Chef::Resource::Launchd do @launchd = Chef::Resource::Launchd.new("io.chef.chef-client") let(:resource) { Chef::Resource::Launchd.new( "io.chef.chef-client", - run_context + run_context, )} it "should create a new Chef::Resource::Launchd" do diff --git a/spec/unit/run_context_spec.rb b/spec/unit/run_context_spec.rb index 33f2f49366..f78f63f494 100644 --- a/spec/unit/run_context_spec.rb +++ b/spec/unit/run_context_spec.rb @@ -57,31 +57,31 @@ describe Chef::RunContext do expect(run_context.node[:cookbooks]).to eql( { "circular-dep1" => { - "version" => "0.0.0" + "version" => "0.0.0", }, "circular-dep2" => { - "version" => "0.0.0" + "version" => "0.0.0", }, "dependency1" => { - "version" => "0.0.0" + "version" => "0.0.0", }, "dependency2" => { - "version" => "0.0.0" + "version" => "0.0.0", }, "include" => { - "version" => "0.0.0" + "version" => "0.0.0", }, "no-default-attr" => { - "version" => "0.0.0" + "version" => "0.0.0", }, "test" => { - "version" => "0.0.0" + "version" => "0.0.0", }, "test-with-circular-deps" => { - "version" => "0.0.0" + "version" => "0.0.0", }, "test-with-deps" => { - "version" => "0.0.0" + "version" => "0.0.0", }, }, ) diff --git a/spec/unit/search/query_spec.rb b/spec/unit/search/query_spec.rb index b23f0277d6..7f815f1757 100644 --- a/spec/unit/search/query_spec.rb +++ b/spec/unit/search/query_spec.rb @@ -98,8 +98,8 @@ describe Chef::Search::Query do "platform" => "nudibranch", "version" => "1.9.3", "target" => "ming-the-merciless", - } - } + }, + }, }, }, { "name" => "my-name-is-jonas", @@ -112,8 +112,8 @@ describe Chef::Search::Query do "platform" => "i386-mingw32", "version" => "1.9.3", "target" => "bilbo", - } - } + }, + }, }, }, { "name" => "my-name-is-flipper", @@ -126,8 +126,8 @@ describe Chef::Search::Query do "platform" => "centos", "version" => "2.0.0", "target" => "uno", - } - } + }, + }, }, }, { "name" => "my-name-is-butters", @@ -140,8 +140,8 @@ describe Chef::Search::Query do "platform" => "solaris2", "version" => "2.1.2", "target" => "random", - } - } + }, + }, }, }, ], diff --git a/spec/unit/user_v1_spec.rb b/spec/unit/user_v1_spec.rb index dd02502ff2..51dc3c9118 100644 --- a/spec/unit/user_v1_spec.rb +++ b/spec/unit/user_v1_spec.rb @@ -508,7 +508,7 @@ describe Chef::UserV1 do describe "reregister" do let(:payload) { { - "username" => "some_username" + "username" => "some_username", } } |