summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2016-02-09 08:17:32 -0800
committerLamont Granquist <lamont@scriptkiddie.org>2016-02-09 08:17:32 -0800
commit37e02399a6e1dd281808a556f1420f8cf6e846fd (patch)
tree86834a5371fccfc474004233e45ab00dd7355574
parentf073747786abbe6ada55ed24b696a03e39c3c45d (diff)
downloadchef-lcg/chefstyle-batch.tar.gz
autofixing auto-inserted delimiterslcg/chefstyle-batch
-rw-r--r--chef-windows.gemspec2
-rw-r--r--lib/chef/chef_fs/chef_fs_data_store.rb4
-rw-r--r--lib/chef/cookbook/metadata.rb2
-rw-r--r--lib/chef/event_loggers/windows_eventlog.rb2
-rw-r--r--lib/chef/knife/bootstrap.rb2
-rw-r--r--lib/chef/mixin/windows_architecture_helper.rb4
-rw-r--r--lib/chef/mixin/windows_env_helper.rb4
-rw-r--r--lib/chef/node.rb2
-rw-r--r--lib/chef/provider/group/groupmod.rb2
-rw-r--r--lib/chef/provider/mount/mount.rb2
-rw-r--r--lib/chef/provider/package/pacman.rb2
-rw-r--r--lib/chef/provider/package/rpm.rb2
-rw-r--r--lib/chef/provider/service.rb4
-rw-r--r--lib/chef/provider/service/freebsd.rb2
-rw-r--r--lib/chef/provider/user/useradd.rb2
-rw-r--r--lib/chef/resource/rpm_package.rb2
-rw-r--r--lib/chef/resource/yum_package.rb2
-rw-r--r--spec/functional/resource/cron_spec.rb4
-rw-r--r--spec/functional/resource/deploy_revision_spec.rb2
-rw-r--r--spec/functional/resource/git_spec.rb2
-rw-r--r--spec/functional/resource/group_spec.rb6
-rw-r--r--spec/functional/resource/ifconfig_spec.rb2
-rw-r--r--spec/functional/resource/mount_spec.rb2
-rw-r--r--spec/functional/resource/registry_spec.rb18
-rw-r--r--spec/functional/resource/rpm_spec.rb2
-rw-r--r--spec/functional/resource/template_spec.rb2
-rw-r--r--spec/functional/resource/user/dscl_spec.rb2
-rw-r--r--spec/functional/win32/registry_spec.rb32
-rw-r--r--spec/functional/win32/service_manager_spec.rb10
-rw-r--r--spec/integration/knife/upload_spec.rb20
-rw-r--r--spec/support/shared/functional/windows_script.rb2
-rw-r--r--spec/support/shared/unit/platform_introspector.rb6
-rw-r--r--spec/support/shared/unit/provider/useradd_based_user_provider.rb2
-rw-r--r--spec/unit/audit/control_group_data_spec.rb6
-rw-r--r--spec/unit/chef_class_spec.rb8
-rw-r--r--spec/unit/cookbook/metadata_spec.rb18
-rw-r--r--spec/unit/cookbook_spec.rb4
-rw-r--r--spec/unit/http/validate_content_length_spec.rb8
-rw-r--r--spec/unit/knife/bootstrap/chef_vault_handler_spec.rb4
-rw-r--r--spec/unit/knife/bootstrap_spec.rb2
-rw-r--r--spec/unit/knife/cookbook_download_spec.rb2
-rw-r--r--spec/unit/knife/cookbook_list_spec.rb2
-rw-r--r--spec/unit/knife/cookbook_site_install_spec.rb2
-rw-r--r--spec/unit/knife/cookbook_site_share_spec.rb2
-rw-r--r--spec/unit/knife/cookbook_test_spec.rb2
-rw-r--r--spec/unit/knife/cookbook_upload_spec.rb10
-rw-r--r--spec/unit/knife/core/hashed_command_loader_spec.rb2
-rw-r--r--spec/unit/knife/core/ui_spec.rb16
-rw-r--r--spec/unit/knife/environment_compare_spec.rb2
-rw-r--r--spec/unit/knife/node_environment_set_spec.rb2
-rw-r--r--spec/unit/knife/node_list_spec.rb2
-rw-r--r--spec/unit/knife/node_run_list_remove_spec.rb2
-rw-r--r--spec/unit/knife/role_env_run_list_clear_spec.rb4
-rw-r--r--spec/unit/knife/role_list_spec.rb2
-rw-r--r--spec/unit/knife/tag_delete_spec.rb2
-rw-r--r--spec/unit/knife/user_create_spec.rb10
-rw-r--r--spec/unit/mixin/deep_merge_spec.rb60
-rw-r--r--spec/unit/mixin/params_validate_spec.rb4
-rw-r--r--spec/unit/mixin/properties_spec.rb16
-rw-r--r--spec/unit/mixin/template_spec.rb2
-rw-r--r--spec/unit/mixin/windows_architecture_helper_spec.rb4
-rw-r--r--spec/unit/node/attribute_spec.rb50
-rw-r--r--spec/unit/node_spec.rb12
-rw-r--r--spec/unit/policy_builder/policyfile_spec.rb2
-rw-r--r--spec/unit/property/validation_spec.rb8
-rw-r--r--spec/unit/property_spec.rb2
-rw-r--r--spec/unit/provider/group/dscl_spec.rb6
-rw-r--r--spec/unit/provider/group/groupadd_spec.rb4
-rw-r--r--spec/unit/provider/group/pw_spec.rb8
-rw-r--r--spec/unit/provider/group/usermod_spec.rb4
-rw-r--r--spec/unit/provider/group/windows_spec.rb2
-rw-r--r--spec/unit/provider/group_spec.rb2
-rw-r--r--spec/unit/provider/mount/mount_spec.rb2
-rw-r--r--spec/unit/provider/mount/solaris_spec.rb2
-rw-r--r--spec/unit/provider/package/chocolatey_spec.rb40
-rw-r--r--spec/unit/provider/package/yum_spec.rb42
-rw-r--r--spec/unit/provider/package/zypper_spec.rb4
-rw-r--r--spec/unit/provider/package_spec.rb24
-rw-r--r--spec/unit/provider/service/arch_service_spec.rb2
-rw-r--r--spec/unit/provider/service/freebsd_service_spec.rb10
-rw-r--r--spec/unit/provider/service/macosx_spec.rb2
-rw-r--r--spec/unit/provider/service/openbsd_service_spec.rb8
-rw-r--r--spec/unit/provider/service/redhat_spec.rb4
-rw-r--r--spec/unit/provider/user_spec.rb4
-rw-r--r--spec/unit/recipe_spec.rb2
-rw-r--r--spec/unit/resource/chocolatey_package_spec.rb8
-rw-r--r--spec/unit/resource/cron_spec.rb8
-rw-r--r--spec/unit/resource/dsc_script_spec.rb2
-rw-r--r--spec/unit/resource/group_spec.rb8
-rw-r--r--spec/unit/resource/mdadm_spec.rb4
-rw-r--r--spec/unit/resource/mount_spec.rb8
-rw-r--r--spec/unit/resource/resource_notification_spec.rb4
-rw-r--r--spec/unit/resource_collection/resource_set_spec.rb4
-rw-r--r--spec/unit/resource_collection_spec.rb2
-rw-r--r--spec/unit/resource_spec.rb8
-rw-r--r--spec/unit/role_spec.rb6
-rw-r--r--spec/unit/run_list/run_list_expansion_spec.rb2
-rw-r--r--spec/unit/run_list/versioned_recipe_list_spec.rb8
-rw-r--r--spec/unit/run_list_spec.rb4
-rw-r--r--spec/unit/search/query_spec.rb2
-rw-r--r--spec/unit/util/backup_spec.rb6
-rw-r--r--spec/unit/util/dsc/configuration_generator_spec.rb6
-rw-r--r--spec/unit/util/editor_spec.rb16
103 files changed, 354 insertions, 354 deletions
diff --git a/chef-windows.gemspec b/chef-windows.gemspec
index 11e0b8a667..a4f086cfaf 100644
--- a/chef-windows.gemspec
+++ b/chef-windows.gemspec
@@ -1,6 +1,6 @@
gemspec = eval(IO.read(File.expand_path("../chef.gemspec", __FILE__)))
-gemspec.platform = Gem::Platform.new(%w(universal mingw32))
+gemspec.platform = Gem::Platform.new(%w{universal mingw32})
gemspec.add_dependency "ffi", "~> 1.9"
gemspec.add_dependency "win32-api", "~> 1.5.3"
diff --git a/lib/chef/chef_fs/chef_fs_data_store.rb b/lib/chef/chef_fs/chef_fs_data_store.rb
index f1a114e7f1..2d3330088f 100644
--- a/lib/chef/chef_fs/chef_fs_data_store.rb
+++ b/lib/chef/chef_fs/chef_fs_data_store.rb
@@ -610,7 +610,7 @@ class Chef
private
def use_memory_store?(path)
- return path[0] == "sandboxes" || path[0] == "file_store" && path[1] == "checksums" || path == %w(environments _default)
+ return path[0] == "sandboxes" || path[0] == "file_store" && path[1] == "checksums" || path == %w{environments _default}
end
def write_cookbook(path, data, *options)
@@ -704,7 +704,7 @@ class Chef
# /acls/containers|nodes|.../x.json
# /acls/organization.json
- if path.length == 3 || path == %w(acls organization)
+ if path.length == 3 || path == %w{acls organization}
path = path.dup
path[-1] = "#{path[-1]}.json"
end
diff --git a/lib/chef/cookbook/metadata.rb b/lib/chef/cookbook/metadata.rb
index 73d1cf8379..62e17d4f3b 100644
--- a/lib/chef/cookbook/metadata.rb
+++ b/lib/chef/cookbook/metadata.rb
@@ -485,7 +485,7 @@ class Chef
:description => { :kind_of => String },
:choice => { :kind_of => [ Array ], :default => [] },
:calculated => { :equal_to => [ true, false ], :default => false },
- :type => { :equal_to => %w(string array hash symbol boolean numeric), :default => "string" },
+ :type => { :equal_to => %w{string array hash symbol boolean numeric}, :default => "string" },
:required => { :equal_to => [ "required", "recommended", "optional", true, false ], :default => "optional" },
:recipes => { :kind_of => [ Array ], :default => [] },
:default => { :kind_of => [ String, Array, Hash, Symbol, Numeric, TrueClass, FalseClass ] },
diff --git a/lib/chef/event_loggers/windows_eventlog.rb b/lib/chef/event_loggers/windows_eventlog.rb
index 514fc7b087..84aa906dc7 100644
--- a/lib/chef/event_loggers/windows_eventlog.rb
+++ b/lib/chef/event_loggers/windows_eventlog.rb
@@ -83,7 +83,7 @@ class Chef
[@run_status.run_id,
@run_status.elapsed_time.to_s]
else
- %w(UNKNOWN UNKNOWN)
+ %w{UNKNOWN UNKNOWN}
end
@eventlog.report_event(
diff --git a/lib/chef/knife/bootstrap.rb b/lib/chef/knife/bootstrap.rb
index 27f7a4ddc3..971257bf9e 100644
--- a/lib/chef/knife/bootstrap.rb
+++ b/lib/chef/knife/bootstrap.rb
@@ -220,7 +220,7 @@ class Chef
:long => "--node-ssl-verify-mode [peer|none]",
:description => "Whether or not to verify the SSL cert for all HTTPS requests.",
:proc => Proc.new { |v|
- valid_values = %w(none peer)
+ valid_values = %w{none peer}
unless valid_values.include?(v)
raise "Invalid value '#{v}' for --node-ssl-verify-mode. Valid values are: #{valid_values.join(", ")}"
end
diff --git a/lib/chef/mixin/windows_architecture_helper.rb b/lib/chef/mixin/windows_architecture_helper.rb
index ea058537ea..c55f92b362 100644
--- a/lib/chef/mixin/windows_architecture_helper.rb
+++ b/lib/chef/mixin/windows_architecture_helper.rb
@@ -98,13 +98,13 @@ class Chef
end
def disable_wow64_file_redirection( node )
- if ( node_windows_architecture(node) == :x86_64) && ::Chef::Platform.windows?
+ if ( node_windows_architecture(node) == :x86_64) && ::Chef::Platform.windows?
Chef::ReservedNames::Win32::System.wow64_disable_wow64_fs_redirection
end
end
def restore_wow64_file_redirection( node, original_redirection_state )
- if (node_windows_architecture(node) == :x86_64) && ::Chef::Platform.windows?
+ if (node_windows_architecture(node) == :x86_64) && ::Chef::Platform.windows?
Chef::ReservedNames::Win32::System.wow64_revert_wow64_fs_redirection(original_redirection_state)
end
end
diff --git a/lib/chef/mixin/windows_env_helper.rb b/lib/chef/mixin/windows_env_helper.rb
index 51806da31d..65b4b33cf0 100644
--- a/lib/chef/mixin/windows_env_helper.rb
+++ b/lib/chef/mixin/windows_env_helper.rb
@@ -43,12 +43,12 @@ class Chef
flags = SMTO_BLOCK | SMTO_ABORTIFHUNG | SMTO_NOTIMEOUTIFNOTHUNG
# for why two calls, see:
# http://stackoverflow.com/questions/4968373/why-doesnt-sendmessagetimeout-update-the-environment-variables
- if SendMessageTimeoutA(HWND_BROADCAST, WM_SETTINGCHANGE, 0, FFI::MemoryPointer.from_string("Environment").address, flags, 5000, nil) == 0
+ if SendMessageTimeoutA(HWND_BROADCAST, WM_SETTINGCHANGE, 0, FFI::MemoryPointer.from_string("Environment").address, flags, 5000, nil) == 0
Chef::ReservedNames::Win32::Error.raise!
end
if SendMessageTimeoutW(HWND_BROADCAST, WM_SETTINGCHANGE, 0, FFI::MemoryPointer.from_string(
utf8_to_wide("Environment")
- ).address, flags, 5000, nil) == 0
+ ).address, flags, 5000, nil) == 0
Chef::ReservedNames::Win32::Error.raise!
end
end
diff --git a/lib/chef/node.rb b/lib/chef/node.rb
index 4afba1aeb8..0471fe1171 100644
--- a/lib/chef/node.rb
+++ b/lib/chef/node.rb
@@ -685,7 +685,7 @@ class Chef
def data_for_save
data = for_json
- %w(automatic default normal override).each do |level|
+ %w{automatic default normal override}.each do |level|
whitelist_config_option = "#{level}_attribute_whitelist".to_sym
whitelist = Chef::Config[whitelist_config_option]
unless whitelist.nil? # nil => save everything
diff --git a/lib/chef/provider/group/groupmod.rb b/lib/chef/provider/group/groupmod.rb
index 98846aa418..295d3b3425 100644
--- a/lib/chef/provider/group/groupmod.rb
+++ b/lib/chef/provider/group/groupmod.rb
@@ -25,7 +25,7 @@ class Chef
def load_current_resource
super
- %w(group user).each do |binary|
+ %w{group user}.each do |binary|
raise Chef::Exceptions::Group, "Could not find binary /usr/sbin/#{binary} for #{@new_resource}" unless ::File.exists?("/usr/sbin/#{binary}")
end
end
diff --git a/lib/chef/provider/mount/mount.rb b/lib/chef/provider/mount/mount.rb
index 8f9f8b05d4..635a4f6ea2 100644
--- a/lib/chef/provider/mount/mount.rb
+++ b/lib/chef/provider/mount/mount.rb
@@ -42,7 +42,7 @@ class Chef
def mountable?
# only check for existence of non-remote devices
- if device_should_exist? && !::File.exists?(device_real)
+ 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) )
raise Chef::Exceptions::Mount, "Mount point #{@new_resource.mount_point} does not exist"
diff --git a/lib/chef/provider/package/pacman.rb b/lib/chef/provider/package/pacman.rb
index 460f4c4ea2..fe321037bd 100644
--- a/lib/chef/provider/package/pacman.rb
+++ b/lib/chef/provider/package/pacman.rb
@@ -52,7 +52,7 @@ class Chef
def candidate_version
return @candidate_version if @candidate_version
- repos = %w(extra core community)
+ repos = %w{extra core community}
if(::File.exists?("/etc/pacman.conf"))
pacman = ::File.read("/etc/pacman.conf")
diff --git a/lib/chef/provider/package/rpm.rb b/lib/chef/provider/package/rpm.rb
index c00f0ebbd4..777cc6d209 100644
--- a/lib/chef/provider/package/rpm.rb
+++ b/lib/chef/provider/package/rpm.rb
@@ -25,7 +25,7 @@ class Chef
class Package
class Rpm < Chef::Provider::Package
- provides :rpm_package, os: %w(linux aix)
+ provides :rpm_package, os: %w{linux aix}
include Chef::Mixin::GetSourceFromPackage
diff --git a/lib/chef/provider/service.rb b/lib/chef/provider/service.rb
index 3b78cb4afc..d716e44342 100644
--- a/lib/chef/provider/service.rb
+++ b/lib/chef/provider/service.rb
@@ -50,10 +50,10 @@ class Chef
# XXX?: the #nil? check below will likely fail if this is a cloned resource or if
# we just run multiple actions.
def load_new_resource_state
- if @new_resource.enabled.nil?
+ if @new_resource.enabled.nil?
@new_resource.enabled(@current_resource.enabled)
end
- if @new_resource.running.nil?
+ if @new_resource.running.nil?
@new_resource.running(@current_resource.running)
end
end
diff --git a/lib/chef/provider/service/freebsd.rb b/lib/chef/provider/service/freebsd.rb
index e556eccf22..76d8c1d17b 100644
--- a/lib/chef/provider/service/freebsd.rb
+++ b/lib/chef/provider/service/freebsd.rb
@@ -27,7 +27,7 @@ class Chef
attr_reader :enabled_state_found
- provides :service, os: %w(freebsd netbsd)
+ provides :service, os: %w{freebsd netbsd}
include Chef::Mixin::ShellOut
diff --git a/lib/chef/provider/user/useradd.rb b/lib/chef/provider/user/useradd.rb
index 708631e4ab..e2f5b5897a 100644
--- a/lib/chef/provider/user/useradd.rb
+++ b/lib/chef/provider/user/useradd.rb
@@ -75,7 +75,7 @@ class Chef
unless passwd_s.exitstatus == 0
raise_lock_error = false
- if %w(redhat centos).include?(node[:platform])
+ if %w{redhat centos}.include?(node[:platform])
passwd_version_check = shell_out!("rpm -q passwd")
passwd_version = passwd_version_check.stdout.chomp
diff --git a/lib/chef/resource/rpm_package.rb b/lib/chef/resource/rpm_package.rb
index 72598b6a83..c93dfecaf5 100644
--- a/lib/chef/resource/rpm_package.rb
+++ b/lib/chef/resource/rpm_package.rb
@@ -23,7 +23,7 @@ class Chef
class Resource
class RpmPackage < Chef::Resource::Package
resource_name :rpm_package
- provides :rpm_package, os: %w(linux aix)
+ provides :rpm_package, os: %w{linux aix}
property :allow_downgrade, [ true, false ], default: false, desired_state: false
diff --git a/lib/chef/resource/yum_package.rb b/lib/chef/resource/yum_package.rb
index c7d18f0dc2..1f749b93c0 100644
--- a/lib/chef/resource/yum_package.rb
+++ b/lib/chef/resource/yum_package.rb
@@ -23,7 +23,7 @@ class Chef
class Resource
class YumPackage < Chef::Resource::Package
resource_name :yum_package
- provides :package, os: "linux", platform_family: %w(rhel fedora)
+ provides :package, os: "linux", platform_family: %w{rhel fedora}
# Install a specific arch
property :arch, [ String, Array ]
diff --git a/spec/functional/resource/cron_spec.rb b/spec/functional/resource/cron_spec.rb
index b3464ab22a..3380eccb0d 100644
--- a/spec/functional/resource/cron_spec.rb
+++ b/spec/functional/resource/cron_spec.rb
@@ -104,7 +104,7 @@ describe Chef::Resource::Cron, :requires_root, :unix_only do
end
end
- exclude_solaris = %w(solaris opensolaris solaris2 omnios).include?(ohai[:platform])
+ exclude_solaris = %w{solaris opensolaris solaris2 omnios}.include?(ohai[:platform])
describe "create action with various attributes", :external => exclude_solaris do
def create_and_validate_with_attribute(resource, attribute, value)
if ohai[:platform] == "aix"
@@ -117,7 +117,7 @@ describe Chef::Resource::Cron, :requires_root, :unix_only do
end
def cron_attribute_should_exists(cron_name, attribute, value)
- return if %w(aix solaris).include?(ohai[:platform])
+ return if %w{aix solaris}.include?(ohai[:platform])
# Test if the attribute exists on newly created cron
cron_should_exists(cron_name, "")
expect(shell_out("crontab -l -u #{new_resource.user} | grep \"#{attribute.upcase}=#{value}\"").exitstatus).to eq(0)
diff --git a/spec/functional/resource/deploy_revision_spec.rb b/spec/functional/resource/deploy_revision_spec.rb
index 2231712dcb..ee98832180 100644
--- a/spec/functional/resource/deploy_revision_spec.rb
+++ b/spec/functional/resource/deploy_revision_spec.rb
@@ -45,7 +45,7 @@ describe Chef::Resource::DeployRevision, :unix_only => true do
before(:all) do
@ohai = Ohai::System.new
- @ohai.all_plugins(%w(platform os))
+ @ohai.all_plugins(%w{platform os})
end
let(:node) do
diff --git a/spec/functional/resource/git_spec.rb b/spec/functional/resource/git_spec.rb
index cace34b714..92c2dd2074 100644
--- a/spec/functional/resource/git_spec.rb
+++ b/spec/functional/resource/git_spec.rb
@@ -92,7 +92,7 @@ E
before(:all) do
@ohai = Ohai::System.new
- @ohai.all_plugins(%w(platform os))
+ @ohai.all_plugins(%w{platform os})
end
context "working with pathes with special characters" do
diff --git a/spec/functional/resource/group_spec.rb b/spec/functional/resource/group_spec.rb
index 25f0989783..521c8e887d 100644
--- a/spec/functional/resource/group_spec.rb
+++ b/spec/functional/resource/group_spec.rb
@@ -361,7 +361,7 @@ downthestreetalwayshadagoodsmileonhisfacetheoldmanwalkingdownthestreeQQQQQQ" }
end
describe "group modify action", :not_supported_on_solaris do
- let(:spec_members) { %w(mnou5sdz htulrvwq x4c3g1lu) }
+ let(:spec_members) { %w{mnou5sdz htulrvwq x4c3g1lu} }
let(:included_members) { [spec_members[0], spec_members[1]] }
let(:excluded_members) { [spec_members[2]] }
let(:tested_action) { :modify }
@@ -389,7 +389,7 @@ downthestreetalwayshadagoodsmileonhisfacetheoldmanwalkingdownthestreeQQQQQQ" }
end
describe "group manage action", :not_supported_on_solaris do
- let(:spec_members) { %w(mnou5sdz htulrvwq x4c3g1lu) }
+ let(:spec_members) { %w{mnou5sdz htulrvwq x4c3g1lu} }
let(:included_members) { [spec_members[0], spec_members[1]] }
let(:excluded_members) { [spec_members[2]] }
let(:tested_action) { :manage }
@@ -443,7 +443,7 @@ downthestreetalwayshadagoodsmileonhisfacetheoldmanwalkingdownthestreeQQQQQQ" }
end
describe "when append is not set" do
- let(:included_members) { %w(gordon eric) }
+ let(:included_members) { %w{gordon eric} }
before(:each) do
group_resource.append(false)
diff --git a/spec/functional/resource/ifconfig_spec.rb b/spec/functional/resource/ifconfig_spec.rb
index b8229fd3a6..a30dcff641 100644
--- a/spec/functional/resource/ifconfig_spec.rb
+++ b/spec/functional/resource/ifconfig_spec.rb
@@ -20,7 +20,7 @@ require "functional/resource/base"
require "chef/mixin/shell_out"
# run this test only for following platforms.
-include_flag = !(%w(ubuntu centos aix).include?(ohai[:platform]))
+include_flag = !(%w{ubuntu centos aix}.include?(ohai[:platform]))
describe Chef::Resource::Ifconfig, :requires_root, :skip_travis, :external => include_flag do
# This test does not work in travis because there is no eth0
diff --git a/spec/functional/resource/mount_spec.rb b/spec/functional/resource/mount_spec.rb
index a00b937fcf..c756b0d3d4 100644
--- a/spec/functional/resource/mount_spec.rb
+++ b/spec/functional/resource/mount_spec.rb
@@ -22,7 +22,7 @@ require "chef/mixin/shell_out"
require "tmpdir"
# run this test only for following platforms.
-include_flag = !(%w(ubuntu centos aix solaris2).include?(ohai[:platform]))
+include_flag = !(%w{ubuntu centos aix solaris2}.include?(ohai[:platform]))
describe Chef::Resource::Mount, :requires_root, :skip_travis, :external => include_flag do
# Disabled in travis because it refuses to let us mount a ramdisk. /dev/ramX does not
diff --git a/spec/functional/resource/registry_spec.rb b/spec/functional/resource/registry_spec.rb
index 8be2a70dfb..e64b6697c5 100644
--- a/spec/functional/resource/registry_spec.rb
+++ b/spec/functional/resource/registry_spec.rb
@@ -78,7 +78,7 @@ describe Chef::Resource::RegistryKey, :windows_only, :broken => true do
hive_class.create(key_parent + '\Opscode', Win32::Registry::KEY_WRITE | flag)
hive_class.open(key_parent + '\Opscode', Win32::Registry::KEY_ALL_ACCESS | flag) do |reg|
reg["Color", Win32::Registry::REG_SZ] = "Orange"
- reg.write("Opscode", Win32::Registry::REG_MULTI_SZ, %w(Seattle Washington))
+ reg.write("Opscode", Win32::Registry::REG_MULTI_SZ, %w{Seattle Washington})
reg["AKA", Win32::Registry::REG_SZ] = "OC"
end
hive_class.create(key_parent + '\ReportKey', Win32::Registry::KEY_WRITE | flag)
@@ -179,12 +179,12 @@ describe Chef::Resource::RegistryKey, :windows_only, :broken => true do
it "creates subkey if parent exists" do
@new_resource.key(reg_child + '\OpscodeTest')
- @new_resource.values([{ :name => "Chef", :type => :multi_string, :data => %w(OpscodeOrange Rules) }])
+ @new_resource.values([{ :name => "Chef", :type => :multi_string, :data => %w{OpscodeOrange Rules} }])
@new_resource.recursive(false)
@new_resource.run_action(:create)
expect(@registry.key_exists?(reg_child + '\OpscodeTest')).to eq(true)
- expect(@registry.value_exists?(reg_child + '\OpscodeTest', { :name => "Chef", :type => :multi_string, :data => %w(OpscodeOrange Rules) })).to eq(true)
+ expect(@registry.value_exists?(reg_child + '\OpscodeTest', { :name => "Chef", :type => :multi_string, :data => %w{OpscodeOrange Rules} })).to eq(true)
end
it "gives error if action create and parent does not exist and recursive is set to false" do
@@ -312,12 +312,12 @@ describe Chef::Resource::RegistryKey, :windows_only, :broken => true do
it "creates subkey if parent exists" do
@new_resource.key(reg_child + '\Pyrovile')
- @new_resource.values([{ :name => "Chef", :type => :multi_string, :data => %w(OpscodeOrange Rules) }])
+ @new_resource.values([{ :name => "Chef", :type => :multi_string, :data => %w{OpscodeOrange Rules} }])
@new_resource.recursive(false)
@new_resource.run_action(:create_if_missing)
expect(@registry.key_exists?(reg_child + '\Pyrovile')).to eq(true)
- expect(@registry.value_exists?(reg_child + '\Pyrovile', { :name => "Chef", :type => :multi_string, :data => %w(OpscodeOrange Rules) })).to eq(true)
+ expect(@registry.value_exists?(reg_child + '\Pyrovile', { :name => "Chef", :type => :multi_string, :data => %w{OpscodeOrange Rules} })).to eq(true)
end
it "gives error if action create and parent does not exist and recursive is set to false" do
@@ -409,7 +409,7 @@ describe Chef::Resource::RegistryKey, :windows_only, :broken => true do
expect(@registry.data_exists?(reg_parent + '\Opscode', { :name => "Color", :type => :string, :data => "Orange" })).to eq(true)
@new_resource.key(reg_parent + '\Opscode')
- @new_resource.values([{ :name => "LooksLike", :type => :multi_string, :data => %w(SeattleGrey OCOrange) }])
+ @new_resource.values([{ :name => "LooksLike", :type => :multi_string, :data => %w{SeattleGrey OCOrange} }])
@new_resource.recursive(false)
@new_resource.run_action(:delete)
@@ -418,18 +418,18 @@ describe Chef::Resource::RegistryKey, :windows_only, :broken => true do
it "deletes only specified values under a key path" do
@new_resource.key(reg_parent + '\Opscode')
- @new_resource.values([{ :name => "Opscode", :type => :multi_string, :data => %w(Seattle Washington) }, { :name => "AKA", :type => :string, :data => "OC" }])
+ @new_resource.values([{ :name => "Opscode", :type => :multi_string, :data => %w{Seattle Washington} }, { :name => "AKA", :type => :string, :data => "OC" }])
@new_resource.recursive(false)
@new_resource.run_action(:delete)
expect(@registry.data_exists?(reg_parent + '\Opscode', { :name => "Color", :type => :string, :data => "Orange" })).to eq(true)
expect(@registry.value_exists?(reg_parent + '\Opscode', { :name => "AKA", :type => :string, :data => "OC" })).to eq(false)
- expect(@registry.value_exists?(reg_parent + '\Opscode', { :name => "Opscode", :type => :multi_string, :data => %w(Seattle Washington) })).to eq(false)
+ expect(@registry.value_exists?(reg_parent + '\Opscode', { :name => "Opscode", :type => :multi_string, :data => %w{Seattle Washington} })).to eq(false)
end
it "it deletes the values with the same name irrespective of it type and data" do
@new_resource.key(reg_parent + '\Opscode')
- @new_resource.values([{ :name => "Color", :type => :multi_string, :data => %w(Black Orange) }])
+ @new_resource.values([{ :name => "Color", :type => :multi_string, :data => %w{Black Orange} }])
@new_resource.recursive(false)
@new_resource.run_action(:delete)
diff --git a/spec/functional/resource/rpm_spec.rb b/spec/functional/resource/rpm_spec.rb
index a3c5ecd466..0c2e798954 100644
--- a/spec/functional/resource/rpm_spec.rb
+++ b/spec/functional/resource/rpm_spec.rb
@@ -21,7 +21,7 @@ require "functional/resource/base"
require "chef/mixin/shell_out"
# run this test only for following platforms.
-exclude_test = !%w(aix centos redhat suse).include?(ohai[:platform])
+exclude_test = !%w{aix centos redhat suse}.include?(ohai[:platform])
describe Chef::Resource::RpmPackage, :requires_root, :external => exclude_test do
include Chef::Mixin::ShellOut
diff --git a/spec/functional/resource/template_spec.rb b/spec/functional/resource/template_spec.rb
index d1082596fa..f270043f2c 100644
--- a/spec/functional/resource/template_spec.rb
+++ b/spec/functional/resource/template_spec.rb
@@ -191,7 +191,7 @@ describe Chef::Resource::Template do
describe "when template source contains windows style line endings" do
include_context "diff disabled"
- %w(all some no).each do |test_case|
+ %w{all some no}.each do |test_case|
context "for #{test_case} lines" do
let(:resource) do
r = create_resource
diff --git a/spec/functional/resource/user/dscl_spec.rb b/spec/functional/resource/user/dscl_spec.rb
index d6e85d193c..243471c3f7 100644
--- a/spec/functional/resource/user/dscl_spec.rb
+++ b/spec/functional/resource/user/dscl_spec.rb
@@ -168,7 +168,7 @@ c5adbbac718b7eb99463a7b679571e0f\
end
describe "when a user is member of some groups" do
- let(:groups) { %w(staff operator) }
+ let(:groups) { %w{staff operator} }
before do
existing_resource = user_resource.dup
diff --git a/spec/functional/win32/registry_spec.rb b/spec/functional/win32/registry_spec.rb
index 62af773b61..4f9b742503 100644
--- a/spec/functional/win32/registry_spec.rb
+++ b/spec/functional/win32/registry_spec.rb
@@ -35,7 +35,7 @@ describe "Chef::Win32::Registry", :windows_only do
reg["Strong", Win32::Registry::REG_SZ] = "bird nest"
end
::Win32::Registry::HKEY_CURRENT_USER.open('Software\\Root\\Branch\\Flower', Win32::Registry::KEY_ALL_ACCESS) do |reg|
- reg["Petals", Win32::Registry::REG_MULTI_SZ] = %w(Pink Delicate)
+ reg["Petals", Win32::Registry::REG_MULTI_SZ] = %w{Pink Delicate}
end
#Create the node with ohai data
@@ -137,49 +137,49 @@ describe "Chef::Win32::Registry", :windows_only do
describe "data_exists?" do
it "throws an exception if the hive does not exist" do
- expect { @registry.data_exists?("JKLM\\Software\\Branch\\Flower", { :name => "Petals", :type => :multi_string, :data => %w(Pink Delicate) }) }.to raise_error(Chef::Exceptions::Win32RegHiveMissing)
+ expect { @registry.data_exists?("JKLM\\Software\\Branch\\Flower", { :name => "Petals", :type => :multi_string, :data => %w{Pink Delicate} }) }.to raise_error(Chef::Exceptions::Win32RegHiveMissing)
end
it "throws an exception if the key does not exist" do
- expect { @registry.data_exists?("HKCU\\Software\\Branch\\Flower", { :name => "Petals", :type => :multi_string, :data => %w(Pink Delicate) }) }.to raise_error(Chef::Exceptions::Win32RegKeyMissing)
+ expect { @registry.data_exists?("HKCU\\Software\\Branch\\Flower", { :name => "Petals", :type => :multi_string, :data => %w{Pink Delicate} }) }.to raise_error(Chef::Exceptions::Win32RegKeyMissing)
end
it "returns true if all the data matches" do
- expect(@registry.data_exists?("HKCU\\Software\\Root\\Branch\\Flower", { :name => "Petals", :type => :multi_string, :data => %w(Pink Delicate) })).to eq(true)
+ expect(@registry.data_exists?("HKCU\\Software\\Root\\Branch\\Flower", { :name => "Petals", :type => :multi_string, :data => %w{Pink Delicate} })).to eq(true)
end
it "returns true if all the data matches with a case mismatch on the data name" do
- expect(@registry.data_exists?("HKCU\\Software\\Root\\Branch\\Flower", { :name => "petals", :type => :multi_string, :data => %w(Pink Delicate) })).to eq(true)
+ expect(@registry.data_exists?("HKCU\\Software\\Root\\Branch\\Flower", { :name => "petals", :type => :multi_string, :data => %w{Pink Delicate} })).to eq(true)
end
it "returns false if the name does not exist" do
- expect(@registry.data_exists?("HKCU\\Software\\Root\\Branch\\Flower", { :name => "slateP", :type => :multi_string, :data => %w(Pink Delicate) })).to eq(false)
+ expect(@registry.data_exists?("HKCU\\Software\\Root\\Branch\\Flower", { :name => "slateP", :type => :multi_string, :data => %w{Pink Delicate} })).to eq(false)
end
it "returns false if the types do not match" do
expect(@registry.data_exists?("HKCU\\Software\\Root\\Branch\\Flower", { :name => "Petals", :type => :string, :data => "Pink" })).to eq(false)
end
it "returns false if the data does not match" do
- expect(@registry.data_exists?("HKCU\\Software\\Root\\Branch\\Flower", { :name => "Petals", :type => :multi_string, :data => %w(Mauve Delicate) })).to eq(false)
+ expect(@registry.data_exists?("HKCU\\Software\\Root\\Branch\\Flower", { :name => "Petals", :type => :multi_string, :data => %w{Mauve Delicate} })).to eq(false)
end
end
describe "data_exists!" do
it "throws an exception if the hive does not exist" do
- expect { @registry.data_exists!("JKLM\\Software\\Branch\\Flower", { :name => "Petals", :type => :multi_string, :data => %w(Pink Delicate) }) }.to raise_error(Chef::Exceptions::Win32RegHiveMissing)
+ expect { @registry.data_exists!("JKLM\\Software\\Branch\\Flower", { :name => "Petals", :type => :multi_string, :data => %w{Pink Delicate} }) }.to raise_error(Chef::Exceptions::Win32RegHiveMissing)
end
it "throws an exception if the key does not exist" do
- expect { @registry.data_exists!("HKCU\\Software\\Branch\\Flower", { :name => "Petals", :type => :multi_string, :data => %w(Pink Delicate) }) }.to raise_error(Chef::Exceptions::Win32RegKeyMissing)
+ expect { @registry.data_exists!("HKCU\\Software\\Branch\\Flower", { :name => "Petals", :type => :multi_string, :data => %w{Pink Delicate} }) }.to raise_error(Chef::Exceptions::Win32RegKeyMissing)
end
it "returns true if all the data matches" do
- expect(@registry.data_exists!("HKCU\\Software\\Root\\Branch\\Flower", { :name => "Petals", :type => :multi_string, :data => %w(Pink Delicate) })).to eq(true)
+ expect(@registry.data_exists!("HKCU\\Software\\Root\\Branch\\Flower", { :name => "Petals", :type => :multi_string, :data => %w{Pink Delicate} })).to eq(true)
end
it "returns true if all the data matches with a case mismatch on the data name" do
- expect(@registry.data_exists!("HKCU\\Software\\Root\\Branch\\Flower", { :name => "petals", :type => :multi_string, :data => %w(Pink Delicate) })).to eq(true)
+ expect(@registry.data_exists!("HKCU\\Software\\Root\\Branch\\Flower", { :name => "petals", :type => :multi_string, :data => %w{Pink Delicate} })).to eq(true)
end
it "throws an exception if the name does not exist" do
- expect { @registry.data_exists!("HKCU\\Software\\Root\\Branch\\Flower", { :name => "slateP", :type => :multi_string, :data => %w(Pink Delicate) }) }.to raise_error(Chef::Exceptions::Win32RegDataMissing)
+ expect { @registry.data_exists!("HKCU\\Software\\Root\\Branch\\Flower", { :name => "slateP", :type => :multi_string, :data => %w{Pink Delicate} }) }.to raise_error(Chef::Exceptions::Win32RegDataMissing)
end
it "throws an exception if the types do not match" do
expect { @registry.data_exists!("HKCU\\Software\\Root\\Branch\\Flower", { :name => "Petals", :type => :string, :data => "Pink" }) }.to raise_error(Chef::Exceptions::Win32RegDataMissing)
end
it "throws an exception if the data does not match" do
- expect { @registry.data_exists!("HKCU\\Software\\Root\\Branch\\Flower", { :name => "Petals", :type => :multi_string, :data => %w(Mauve Delicate) }) }.to raise_error(Chef::Exceptions::Win32RegDataMissing)
+ expect { @registry.data_exists!("HKCU\\Software\\Root\\Branch\\Flower", { :name => "Petals", :type => :multi_string, :data => %w{Mauve Delicate} }) }.to raise_error(Chef::Exceptions::Win32RegDataMissing)
end
end
@@ -243,13 +243,13 @@ describe "Chef::Win32::Registry", :windows_only do
end
it "throws an exception when trying to cast an array to an int for a dword" do
- expect { @registry.set_value("HKCU\\Software\\Root\\Branch\\Flower", { :name => "ShouldThrow", :type => :dword, :data => %w(one two) }) }.to raise_error
+ expect { @registry.set_value("HKCU\\Software\\Root\\Branch\\Flower", { :name => "ShouldThrow", :type => :dword, :data => %w{one two} }) }.to raise_error
end
# we are validating that the data gets .to_s called on it when type is a :string
it "stores the string representation of an array into a string if you pass it an array" do
- expect(@registry.set_value("HKCU\\Software\\Root\\Branch\\Flower", { :name => "ShouldBePainful", :type => :string, :data => %w(one two) })).to eq(true)
+ expect(@registry.set_value("HKCU\\Software\\Root\\Branch\\Flower", { :name => "ShouldBePainful", :type => :string, :data => %w{one two} })).to eq(true)
expect(@registry.data_exists?("HKCU\\Software\\Root\\Branch\\Flower", { :name => "ShouldBePainful", :type => :string, :data => '["one", "two"]' })).to eq(true)
end
@@ -330,7 +330,7 @@ describe "Chef::Win32::Registry", :windows_only do
before (:all) do
::Win32::Registry::HKEY_CURRENT_USER.create "Software\\Root\\Branch\\Fruit"
::Win32::Registry::HKEY_CURRENT_USER.open('Software\\Root\\Branch\\Fruit', Win32::Registry::KEY_ALL_ACCESS) do |reg|
- reg["Apple", Win32::Registry::REG_MULTI_SZ] = %w(Red Juicy)
+ reg["Apple", Win32::Registry::REG_MULTI_SZ] = %w{Red Juicy}
end
::Win32::Registry::HKEY_CURRENT_USER.create "Software\\Root\\Trunk\\Peck\\Woodpecker"
::Win32::Registry::HKEY_CURRENT_USER.open('Software\\Root\\Trunk\\Peck\\Woodpecker', Win32::Registry::KEY_ALL_ACCESS) do |reg|
diff --git a/spec/functional/win32/service_manager_spec.rb b/spec/functional/win32/service_manager_spec.rb
index 33c6397af7..8fff73396e 100644
--- a/spec/functional/win32/service_manager_spec.rb
+++ b/spec/functional/win32/service_manager_spec.rb
@@ -81,7 +81,7 @@ describe "Chef::Application::WindowsServiceManager", :windows_only, :system_wind
end
it "other actions => should say service doesn't exist" do
- %w(delete start stop pause resume uninstall).each do |action|
+ %w{delete start stop pause resume uninstall}.each do |action|
service_manager.run(["-a", action])
expect(@service_manager_output.grep(/doesn't exist on the system/).length).to be > 0
@service_manager_output = [ ]
@@ -106,7 +106,7 @@ describe "Chef::Application::WindowsServiceManager", :windows_only, :system_wind
end
context "and service is stopped" do
- %w(delete uninstall).each do |action|
+ %w{delete uninstall}.each do |action|
it "#{action} => should remove the service", :volatile do
service_manager.run(["-a", action])
expect(test_service_exists?).to be_falsey
@@ -133,7 +133,7 @@ describe "Chef::Application::WindowsServiceManager", :windows_only, :system_wind
expect(test_service_state).to eq("stopped")
end
- %w(pause resume).each do |action|
+ %w{pause resume}.each do |action|
it "#{action} => should raise error" do
expect { service_manager.run(["-a", action]) }.to raise_error(SystemCallError)
end
@@ -144,7 +144,7 @@ describe "Chef::Application::WindowsServiceManager", :windows_only, :system_wind
service_manager.run(["-a", "start"])
end
- %w(delete uninstall).each do |action|
+ %w{delete uninstall}.each do |action|
it "#{action} => should remove the service", :volatile do
service_manager.run(["-a", action])
expect(test_service_exists?).to be_falsey
@@ -182,7 +182,7 @@ describe "Chef::Application::WindowsServiceManager", :windows_only, :system_wind
service_manager.run(["-a", "pause"])
end
- actions = %w(delete uninstall)
+ actions = %w{delete uninstall}
actions.each do |action|
it "#{action} => should remove the service" do
service_manager.run(["-a", action])
diff --git a/spec/integration/knife/upload_spec.rb b/spec/integration/knife/upload_spec.rb
index 44a4a872bd..5d136968dd 100644
--- a/spec/integration/knife/upload_spec.rb
+++ b/spec/integration/knife/upload_spec.rb
@@ -280,7 +280,7 @@ Created /data_bags/x/y.json
EOM
knife("diff --name-status /data_bags").should_succeed <<EOM
EOM
- expect(Chef::JSONCompat.parse(knife("raw /data/x/y").stdout, :create_additions => false).keys.sort).to eq(%w(foo id))
+ expect(Chef::JSONCompat.parse(knife("raw /data/x/y").stdout, :create_additions => false).keys.sort).to eq(%w{foo id})
end
it "knife upload /data_bags/x /data_bags/x/y.json uploads x once" do
@@ -304,7 +304,7 @@ Created /data_bags/x/y.json
EOM
knife("diff --name-status /data_bags").should_succeed ""
result = Chef::JSONCompat.parse(knife("raw /data/x/y").stdout, :create_additions => false)
- expect(result.keys.sort).to eq(%w(chef_type data_bag id))
+ expect(result.keys.sort).to eq(%w{chef_type data_bag id})
expect(result["chef_type"]).to eq("aaa")
expect(result["data_bag"]).to eq("bbb")
end
@@ -1457,25 +1457,25 @@ EOM
when_the_repository "wants to invite foo, bar and foobar" do
before do
- file "invitations.json", %w(foo bar foobar)
+ file "invitations.json", %w{foo bar foobar}
end
it "knife upload / emits a warning for bar and invites foobar" do
knife("upload /").should_succeed "Updated /invitations.json\n", :stderr => "WARN: Could not invite bar to organization foo: User bar is already in organization foo\n"
- expect(api.get("association_requests").map { |a| a["username"] }).to eq(%w(foo foobar))
+ expect(api.get("association_requests").map { |a| a["username"] }).to eq(%w{foo foobar})
expect(api.get("users").map { |a| a["user"]["username"] }).to eq([ "bar" ])
end
end
when_the_repository "wants to make foo, bar and foobar members" do
before do
- file "members.json", %w(foo bar foobar)
+ file "members.json", %w{foo bar foobar}
end
it "knife upload / emits a warning for bar and adds foo and foobar" do
knife("upload /").should_succeed "Updated /members.json\n"
expect(api.get("association_requests").map { |a| a["username"] }).to eq([ ])
- expect(api.get("users").map { |a| a["user"]["username"] }).to eq(%w(bar foo foobar))
+ expect(api.get("users").map { |a| a["user"]["username"] }).to eq(%w{bar foo foobar})
end
end
@@ -1498,12 +1498,12 @@ EOM
when_the_repository "wants to invite foo and bar (different order)" do
before do
- file "invitations.json", %w(foo bar)
+ file "invitations.json", %w{foo bar}
end
it "knife upload / does nothing" do
knife("upload /").should_succeed ""
- expect(api.get("association_requests").map { |a| a["username"] }).to eq(%w(bar foo))
+ expect(api.get("association_requests").map { |a| a["username"] }).to eq(%w{bar foo})
expect(api.get("users").map { |a| a["user"]["username"] }).to eq([ ])
end
end
@@ -1514,13 +1514,13 @@ EOM
when_the_repository "wants to add foo and bar (different order)" do
before do
- file "members.json", %w(foo bar)
+ file "members.json", %w{foo bar}
end
it "knife upload / does nothing" do
knife("upload /").should_succeed ""
expect(api.get("association_requests").map { |a| a["username"] }).to eq([ ])
- expect(api.get("users").map { |a| a["user"]["username"] }).to eq(%w(bar foo))
+ expect(api.get("users").map { |a| a["user"]["username"] }).to eq(%w{bar foo})
end
end
end
diff --git a/spec/support/shared/functional/windows_script.rb b/spec/support/shared/functional/windows_script.rb
index eb456b191f..908198add4 100644
--- a/spec/support/shared/functional/windows_script.rb
+++ b/spec/support/shared/functional/windows_script.rb
@@ -24,7 +24,7 @@ require "chef/platform/query_helpers"
shared_context Chef::Resource::WindowsScript do
before(:all) do
@ohai_reader = Ohai::System.new
- @ohai_reader.all_plugins(%w(platform kernel))
+ @ohai_reader.all_plugins(%w{platform kernel})
new_node = Chef::Node.new
new_node.consume_external_attrs(@ohai_reader.data, {})
diff --git a/spec/support/shared/unit/platform_introspector.rb b/spec/support/shared/unit/platform_introspector.rb
index e458e1b941..7b9cc0f94e 100644
--- a/spec/support/shared/unit/platform_introspector.rb
+++ b/spec/support/shared/unit/platform_introspector.rb
@@ -26,7 +26,7 @@ shared_examples_for "a platform introspector" do
"1.2.3" => "#{x}-1.2.3",
}
end
- @platform_hash["debian"] = { %w(5 6) => "debian-5/6", "default" => "debian" }
+ @platform_hash["debian"] = { %w{5 6} => "debian-5/6", "default" => "debian" }
@platform_hash["default"] = "default"
# The following @platform_hash keys are used for testing version constraints
@platform_hash["exact_match"] = { "1.2.3" => "exact", ">= 1.0" => "not exact" }
@@ -130,7 +130,7 @@ shared_examples_for "a platform introspector" do
it "returns true if the node is a provided platform and platforms are provided as strings" do
node.automatic_attrs[:platform] = "ubuntu"
- expect(platform_introspector.platform?(%w(redhat ubuntu))).to eq(true)
+ expect(platform_introspector.platform?(%w{redhat ubuntu})).to eq(true)
end
it "returns false if the node is not of the provided platforms" do
@@ -148,7 +148,7 @@ shared_examples_for "a platform introspector" do
it "returns true if the node is a provided platform and platforms are provided as strings" do
node.automatic_attrs[:platform_family] = "rhel"
- expect(platform_introspector.platform_family?(%w(rhel debian))).to eq(true)
+ expect(platform_introspector.platform_family?(%w{rhel debian})).to eq(true)
end
it "returns false if the node is not of the provided platforms" do
diff --git a/spec/support/shared/unit/provider/useradd_based_user_provider.rb b/spec/support/shared/unit/provider/useradd_based_user_provider.rb
index 0b024b5b60..6677a069ea 100644
--- a/spec/support/shared/unit/provider/useradd_based_user_provider.rb
+++ b/spec/support/shared/unit/provider/useradd_based_user_provider.rb
@@ -315,7 +315,7 @@ shared_examples_for "a useradd-based user provider" do |supported_useradd_option
expect { provider.check_lock }.to raise_error(Chef::Exceptions::User)
end
- %w(redhat centos).each do |os|
+ %w{redhat centos}.each do |os|
it "should not raise a Chef::Exceptions::User if passwd -S exits with 1 on #{os} and the passwd package is version 0.73-1" do
@node.automatic_attrs[:platform] = os
expect(passwd_s_status).to receive(:exitstatus).and_return(1)
diff --git a/spec/unit/audit/control_group_data_spec.rb b/spec/unit/audit/control_group_data_spec.rb
index 2e21a13b17..a7c8850350 100644
--- a/spec/unit/audit/control_group_data_spec.rb
+++ b/spec/unit/audit/control_group_data_spec.rb
@@ -360,19 +360,19 @@ describe Chef::Audit::ControlGroupData do
context "and it's the first audit" do
include_examples "mixed audit results" do
- let(:audit_results) { %w(failure success success) }
+ let(:audit_results) { %w{failure success success} }
end
end
context "and it's an audit in the middle" do
include_examples "mixed audit results" do
- let(:audit_results) { %w(success failure success) }
+ let(:audit_results) { %w{success failure success} }
end
end
context "and it's the last audit" do
include_examples "mixed audit results" do
- let(:audit_results) { %w(success success failure) }
+ let(:audit_results) { %w{success success failure} }
end
end
end
diff --git a/spec/unit/chef_class_spec.rb b/spec/unit/chef_class_spec.rb
index 6a52e17dd5..3c8411ef2a 100644
--- a/spec/unit/chef_class_spec.rb
+++ b/spec/unit/chef_class_spec.rb
@@ -61,14 +61,14 @@ describe "Chef class" do
end
context "#set_provider_priority_array" do
it "should delegate to the provider_priority_map" do
- expect(provider_priority_map).to receive(:set_priority_array).with(:http_request, %w(a b), platform: "debian").and_return("stuff")
- expect(Chef.set_provider_priority_array(:http_request, %w(a b), platform: "debian")).to eql("stuff")
+ expect(provider_priority_map).to receive(:set_priority_array).with(:http_request, %w{a b}, platform: "debian").and_return("stuff")
+ expect(Chef.set_provider_priority_array(:http_request, %w{a b}, platform: "debian")).to eql("stuff")
end
end
context "#set_priority_map_for_resource" do
it "should delegate to the resource_priority_map" do
- expect(resource_priority_map).to receive(:set_priority_array).with(:http_request, %w(a b), platform: "debian").and_return("stuff")
- expect(Chef.set_resource_priority_array(:http_request, %w(a b), platform: "debian")).to eql("stuff")
+ expect(resource_priority_map).to receive(:set_priority_array).with(:http_request, %w{a b}, platform: "debian").and_return("stuff")
+ expect(Chef.set_resource_priority_array(:http_request, %w{a b}, platform: "debian")).to eql("stuff")
end
end
end
diff --git a/spec/unit/cookbook/metadata_spec.rb b/spec/unit/cookbook/metadata_spec.rb
index d914ac6692..0107667fcd 100644
--- a/spec/unit/cookbook/metadata_spec.rb
+++ b/spec/unit/cookbook/metadata_spec.rb
@@ -460,7 +460,7 @@ describe Chef::Cookbook::Metadata do
attrs = {
"display_name" => "MySQL Databases",
"description" => "Description of MySQL",
- "choice" => %w(dedicated shared),
+ "choice" => %w{dedicated shared},
"calculated" => false,
"type" => "string",
"required" => "recommended",
@@ -523,7 +523,7 @@ describe Chef::Cookbook::Metadata do
it "should not accept anything but an array of strings for choice" do
expect {
- metadata.attribute("db/mysql/databases", :choice => %w(dedicated shared))
+ metadata.attribute("db/mysql/databases", :choice => %w{dedicated shared})
}.not_to raise_error
expect {
metadata.attribute("db/mysql/databases", :choice => [10, "shared"])
@@ -651,7 +651,7 @@ describe Chef::Cookbook::Metadata do
it "should limit the types allowed in the choice array" do
options = {
:type => "string",
- :choice => %w(test1 test2),
+ :choice => %w{test1 test2},
:default => "test1",
}
expect {
@@ -706,15 +706,15 @@ describe Chef::Cookbook::Metadata do
it "should allow a default that is a choice" do
expect {
attrs = {
- :choice => %w(a b c),
+ :choice => %w{a b c},
:default => "b",
}
metadata.attribute("db/mysql/databases", attrs)
}.not_to raise_error
expect {
attrs = {
- :choice => %w(a b c d e),
- :default => %w(b d),
+ :choice => %w{a b c d e},
+ :default => %w{b d},
}
metadata.attribute("db/mysql/databases", attrs)
}.not_to raise_error
@@ -723,15 +723,15 @@ describe Chef::Cookbook::Metadata do
it "should error if default is not a choice" do
expect {
attrs = {
- :choice => %w(a b c),
+ :choice => %w{a b c},
:default => "d",
}
metadata.attribute("db/mysql/databases", attrs)
}.to raise_error(ArgumentError)
expect {
attrs = {
- :choice => %w(a b c d e),
- :default => %w(b z),
+ :choice => %w{a b c d e},
+ :default => %w{b z},
}
metadata.attribute("db/mysql/databases", attrs)
}.to raise_error(ArgumentError)
diff --git a/spec/unit/cookbook_spec.rb b/spec/unit/cookbook_spec.rb
index 6ec0bcd2a2..33b4a3ccd8 100644
--- a/spec/unit/cookbook_spec.rb
+++ b/spec/unit/cookbook_spec.rb
@@ -39,7 +39,7 @@ describe Chef::CookbookVersion do
it "should allow you to set the list of attribute files and create the mapping from short names to paths" do
@cookbook.attribute_filenames = [ "attributes/one.rb", "attributes/two.rb" ]
expect(@cookbook.attribute_filenames).to eq([ "attributes/one.rb", "attributes/two.rb" ])
- expect(@cookbook.attribute_filenames_by_short_filename.keys.sort).to eql(%w(one two))
+ expect(@cookbook.attribute_filenames_by_short_filename.keys.sort).to eql(%w{one two})
expect(@cookbook.attribute_filenames_by_short_filename["one"]).to eq("attributes/one.rb")
expect(@cookbook.attribute_filenames_by_short_filename["two"]).to eq("attributes/two.rb")
end
@@ -47,7 +47,7 @@ describe Chef::CookbookVersion do
it "should allow you to set the list of recipe files and create the mapping of recipe short name to filename" do
@cookbook.recipe_filenames = [ "recipes/one.rb", "recipes/two.rb" ]
expect(@cookbook.recipe_filenames).to eq([ "recipes/one.rb", "recipes/two.rb" ])
- expect(@cookbook.recipe_filenames_by_name.keys.sort).to eql(%w(one two))
+ expect(@cookbook.recipe_filenames_by_name.keys.sort).to eql(%w{one two})
expect(@cookbook.recipe_filenames_by_name["one"]).to eq("recipes/one.rb")
expect(@cookbook.recipe_filenames_by_name["two"]).to eq("recipes/two.rb")
end
diff --git a/spec/unit/http/validate_content_length_spec.rb b/spec/unit/http/validate_content_length_spec.rb
index 3e129dc646..c852d7b5c7 100644
--- a/spec/unit/http/validate_content_length_spec.rb
+++ b/spec/unit/http/validate_content_length_spec.rb
@@ -107,7 +107,7 @@ describe Chef::HTTP::ValidateContentLength do
describe "without Content-Length header" do
let(:response_headers) { {} }
- %w(direct streaming).each do |req_type|
+ %w{direct streaming}.each do |req_type|
describe "when running #{req_type} request" do
let(:request_type) { req_type.to_sym }
@@ -120,7 +120,7 @@ describe Chef::HTTP::ValidateContentLength do
end
describe "with correct Content-Length header" do
- %w(direct streaming).each do |req_type|
+ %w{direct streaming}.each do |req_type|
describe "when running #{req_type} request" do
let(:request_type) { req_type.to_sym }
@@ -134,7 +134,7 @@ describe Chef::HTTP::ValidateContentLength do
describe "with wrong Content-Length header" do
let(:content_length_value) { 25 }
- %w(direct streaming).each do |req_type|
+ %w{direct streaming}.each do |req_type|
describe "when running #{req_type} request" do
let(:request_type) { req_type.to_sym }
@@ -161,7 +161,7 @@ describe Chef::HTTP::ValidateContentLength do
}
}
- %w(direct streaming).each do |req_type|
+ %w{direct streaming}.each do |req_type|
describe "when running #{req_type} request" do
let(:request_type) { req_type.to_sym }
diff --git a/spec/unit/knife/bootstrap/chef_vault_handler_spec.rb b/spec/unit/knife/bootstrap/chef_vault_handler_spec.rb
index 61aa9d0ae1..734b27216d 100644
--- a/spec/unit/knife/bootstrap/chef_vault_handler_spec.rb
+++ b/spec/unit/knife/bootstrap/chef_vault_handler_spec.rb
@@ -69,14 +69,14 @@ describe Chef::Knife::Bootstrap::ChefVaultHandler do
end
it "sets two items as an array" do
- knife_config[:bootstrap_vault_item] = { "vault" => %w(item1 item2) }
+ knife_config[:bootstrap_vault_item] = { "vault" => %w{item1 item2} }
expect(chef_vault_handler).to receive(:load_chef_bootstrap_vault_item).with("vault", "item1").and_return(bootstrap_vault_item)
expect(chef_vault_handler).to receive(:load_chef_bootstrap_vault_item).with("vault", "item2").and_return(bootstrap_vault_item)
chef_vault_handler.run(client)
end
it "sets two vaults from different hash keys" do
- knife_config[:bootstrap_vault_item] = { "vault" => %w(item1 item2), "vault2" => [ "item3" ] }
+ knife_config[:bootstrap_vault_item] = { "vault" => %w{item1 item2}, "vault2" => [ "item3" ] }
expect(chef_vault_handler).to receive(:load_chef_bootstrap_vault_item).with("vault", "item1").and_return(bootstrap_vault_item)
expect(chef_vault_handler).to receive(:load_chef_bootstrap_vault_item).with("vault", "item2").and_return(bootstrap_vault_item)
expect(chef_vault_handler).to receive(:load_chef_bootstrap_vault_item).with("vault2", "item3").and_return(bootstrap_vault_item)
diff --git a/spec/unit/knife/bootstrap_spec.rb b/spec/unit/knife/bootstrap_spec.rb
index 357fee3867..3425b94c76 100644
--- a/spec/unit/knife/bootstrap_spec.rb
+++ b/spec/unit/knife/bootstrap_spec.rb
@@ -51,7 +51,7 @@ describe Chef::Knife::Bootstrap do
context "with --bootstrap-vault-item" do
let(:bootstrap_cli_options) { [ "--bootstrap-vault-item", "vault1:item1", "--bootstrap-vault-item", "vault1:item2", "--bootstrap-vault-item", "vault2:item1" ] }
it "sets the knife config cli option correctly" do
- expect(knife.config[:bootstrap_vault_item]).to eq({ "vault1" => %w(item1 item2), "vault2" => ["item1"] })
+ expect(knife.config[:bootstrap_vault_item]).to eq({ "vault1" => %w{item1 item2}, "vault2" => ["item1"] })
end
end
diff --git a/spec/unit/knife/cookbook_download_spec.rb b/spec/unit/knife/cookbook_download_spec.rb
index 44a47d8c37..991abea776 100644
--- a/spec/unit/knife/cookbook_download_spec.rb
+++ b/spec/unit/knife/cookbook_download_spec.rb
@@ -119,7 +119,7 @@ describe Chef::Knife::CookbookDownload do
it "should download the cookbook when the cookbook download directory doesn't exist" do
expect(File).to receive(:exists?).with("/var/tmp/chef/foobar-1.0.0").and_return(false)
@knife.run
- %w(attributes recipes templates).each do |segment|
+ %w{attributes recipes templates}.each do |segment|
expect(@stderr.string).to match /downloading #{segment}/im
end
expect(@stderr.string).to match /downloading foobar cookbook version 1\.0\.0/im
diff --git a/spec/unit/knife/cookbook_list_spec.rb b/spec/unit/knife/cookbook_list_spec.rb
index ba834e08e2..fce6bc9593 100644
--- a/spec/unit/knife/cookbook_list_spec.rb
+++ b/spec/unit/knife/cookbook_list_spec.rb
@@ -23,7 +23,7 @@ describe Chef::Knife::CookbookList do
@knife = Chef::Knife::CookbookList.new
@rest_mock = double("rest")
allow(@knife).to receive(:rest).and_return(@rest_mock)
- @cookbook_names = %w(apache2 mysql)
+ @cookbook_names = %w{apache2 mysql}
@base_url = "https://server.example.com/cookbooks"
@cookbook_data = {}
@cookbook_names.each do |item|
diff --git a/spec/unit/knife/cookbook_site_install_spec.rb b/spec/unit/knife/cookbook_site_install_spec.rb
index 990e9ae098..d60443d779 100644
--- a/spec/unit/knife/cookbook_site_install_spec.rb
+++ b/spec/unit/knife/cookbook_site_install_spec.rb
@@ -71,7 +71,7 @@ describe Chef::Knife::CookbookSiteInstall do
end
it "raises an error if more than two arguments are given" do
- knife.name_args = %w(foo bar baz)
+ knife.name_args = %w{foo bar baz}
expect(knife.ui).to receive(:error).with("Installing multiple cookbooks at once is not supported.")
expect { knife.run }.to raise_error(SystemExit)
end
diff --git a/spec/unit/knife/cookbook_site_share_spec.rb b/spec/unit/knife/cookbook_site_share_spec.rb
index 4b0f82d417..d5e3915896 100644
--- a/spec/unit/knife/cookbook_site_share_spec.rb
+++ b/spec/unit/knife/cookbook_site_share_spec.rb
@@ -27,7 +27,7 @@ describe Chef::Knife::CookbookSiteShare do
@knife = Chef::Knife::CookbookSiteShare.new
# Merge default settings in.
@knife.merge_configs
- @knife.name_args = %w(cookbook_name AwesomeSausage)
+ @knife.name_args = %w{cookbook_name AwesomeSausage}
@cookbook = Chef::CookbookVersion.new("cookbook_name")
diff --git a/spec/unit/knife/cookbook_test_spec.rb b/spec/unit/knife/cookbook_test_spec.rb
index 7f009f99d2..f8b212e271 100644
--- a/spec/unit/knife/cookbook_test_spec.rb
+++ b/spec/unit/knife/cookbook_test_spec.rb
@@ -45,7 +45,7 @@ describe Chef::Knife::CookbookTest do
it "should test multiple cookbooks when provided" do
allow(@knife).to receive(:test_cookbook).and_return(true)
- @knife.name_args = %w(tats jimmy_johns)
+ @knife.name_args = %w{tats jimmy_johns}
expect(@knife).to receive(:test_cookbook).with("tats")
expect(@knife).to receive(:test_cookbook).with("jimmy_johns")
expect(@knife).not_to receive(:test_cookbook).with("central_market")
diff --git a/spec/unit/knife/cookbook_upload_spec.rb b/spec/unit/knife/cookbook_upload_spec.rb
index eb2b1f9856..277da14011 100644
--- a/spec/unit/knife/cookbook_upload_spec.rb
+++ b/spec/unit/knife/cookbook_upload_spec.rb
@@ -96,7 +96,7 @@ describe Chef::Knife::CookbookUpload do
describe "when specifying the same cookbook name twice" do
it "should upload the cookbook only once" do
- knife.name_args = %w(test_cookbook test_cookbook)
+ knife.name_args = %w{test_cookbook test_cookbook}
expect(knife).to receive(:upload).once
knife.run
end
@@ -181,7 +181,7 @@ E
it "should upload all dependencies once" do
knife.config[:depends] = true
- allow(knife).to receive(:cookbook_names).and_return(%w(test_cookbook1 test_cookbook2 test_cookbook3))
+ allow(knife).to receive(:cookbook_names).and_return(%w{test_cookbook1 test_cookbook2 test_cookbook3})
expect(knife).to receive(:upload).exactly(3).times
expect do
Timeout.timeout(5) do
@@ -200,7 +200,7 @@ E
{ "test_cookbook" => cookbook,
"dependency" => cookbook_dependency }[ckbk]
end
- allow(knife).to receive(:cookbook_names).and_return(%w(cookbook_dependency test_cookbook))
+ allow(knife).to receive(:cookbook_names).and_return(%w{cookbook_dependency test_cookbook})
@stdout, @stderr, @stdin = StringIO.new, StringIO.new, StringIO.new
knife.ui = Chef::Knife::UI.new(@stdout, @stderr, @stdin, {})
end
@@ -227,7 +227,7 @@ E
"dependency" => cookbook_dependency,
"dependency2" => cookbook_dependency2 }[ckbk]
end
- allow(knife).to receive(:cookbook_names).and_return(%w(dependency dependency2 test_cookbook))
+ allow(knife).to receive(:cookbook_names).and_return(%w{dependency dependency2 test_cookbook})
expect { knife.run }.to raise_error(SystemExit)
expect(@stderr.string).to include("Cookbook test_cookbook depends on cookbooks which are not currently")
expect(@stderr.string).to include("being uploaded and cannot be found on the server.")
@@ -253,7 +253,7 @@ E
@test_cookbook1 = Chef::CookbookVersion.new("test_cookbook1", "/tmp/blah")
@test_cookbook2 = Chef::CookbookVersion.new("test_cookbook2", "/tmp/blah")
allow(cookbook_loader).to receive(:each).and_yield("test_cookbook1", @test_cookbook1).and_yield("test_cookbook2", @test_cookbook2)
- allow(cookbook_loader).to receive(:cookbook_names).and_return(%w(test_cookbook1 test_cookbook2))
+ allow(cookbook_loader).to receive(:cookbook_names).and_return(%w{test_cookbook1 test_cookbook2})
end
it "should upload all cookbooks" do
diff --git a/spec/unit/knife/core/hashed_command_loader_spec.rb b/spec/unit/knife/core/hashed_command_loader_spec.rb
index 5c4a33b7e0..4ae046cc09 100644
--- a/spec/unit/knife/core/hashed_command_loader_spec.rb
+++ b/spec/unit/knife/core/hashed_command_loader_spec.rb
@@ -83,7 +83,7 @@ describe Chef::Knife::SubcommandLoader::HashedCommandLoader do
end
it "finds the right subcommand even when _'s are elided" do
- expect(loader.subcommand_for_args(%w(cooler b))).to eq("cooler_b")
+ expect(loader.subcommand_for_args(%w{cooler b})).to eq("cooler_b")
end
it "returns nil if the the subcommand isn't in our manifest" do
diff --git a/spec/unit/knife/core/ui_spec.rb b/spec/unit/knife/core/ui_spec.rb
index b5e4aefab6..37974821d7 100644
--- a/spec/unit/knife/core/ui_spec.rb
+++ b/spec/unit/knife/core/ui_spec.rb
@@ -205,7 +205,7 @@ EOM
end
it "formats arrays appropriately" do
- @ui.output(%w(a b))
+ @ui.output(%w{a b})
expect(@out.string).to eq <<EOM
a
b
@@ -228,7 +228,7 @@ EOM
end
it "formats nested arrays appropriately" do
- @ui.output([ %w(a b), %w(c d)])
+ @ui.output([ %w{a b}, %w{c d}])
expect(@out.string).to eq <<EOM
a
b
@@ -239,7 +239,7 @@ EOM
end
it "formats nested arrays with single- and empty subarrays appropriately" do
- @ui.output([ %w(a b), [ "c" ], [], %w(d e)])
+ @ui.output([ %w{a b}, [ "c" ], [], %w{d e}])
expect(@out.string).to eq <<EOM
a
b
@@ -282,7 +282,7 @@ EOM
end
it "formats hashes with array members appropriately" do
- @ui.output({ "a" => %w(foo bar), "b" => "c" })
+ @ui.output({ "a" => %w{foo bar}, "b" => "c" })
expect(@out.string).to eq <<EOM
a:
foo
@@ -301,7 +301,7 @@ EOM
end
it "formats hashes with nested array values appropriately" do
- @ui.output({ "a" => [ %w(foo bar), %w(baz bjork) ], "b" => "c" })
+ @ui.output({ "a" => [ %w{foo bar}, %w{baz bjork} ], "b" => "c" })
# XXX: using a HEREDOC at this point results in a line with required spaces which auto-whitespace removal settings
# on editors will remove and will break this test.
expect(@out.string).to eq("a:\n foo\n bar\n \n baz\n bjork\nb: c\n")
@@ -353,7 +353,7 @@ EOM
it "should return multiple attributes" do
input = { "gi" => "go", "hi" => "ho", "id" => "sample-data-bag-item" }
- @ui.config[:attribute] = %w(gi hi)
+ @ui.config[:attribute] = %w{gi hi}
expect(@ui.format_for_display(input)).to eq({ "sample-data-bag-item" => { "gi" => "go", "hi" => "ho" } })
end
@@ -545,7 +545,7 @@ EOM
end
end
- %w(Y y).each do |answer|
+ %w{Y y}.each do |answer|
describe "with answer #{answer}" do
let(:answer) { answer }
@@ -553,7 +553,7 @@ EOM
end
end
- %w(N n).each do |answer|
+ %w{N n}.each do |answer|
describe "with answer #{answer}" do
let(:answer) { answer }
diff --git a/spec/unit/knife/environment_compare_spec.rb b/spec/unit/knife/environment_compare_spec.rb
index 9d9a61a32f..863cdd4e6e 100644
--- a/spec/unit/knife/environment_compare_spec.rb
+++ b/spec/unit/knife/environment_compare_spec.rb
@@ -42,7 +42,7 @@ describe Chef::Knife::EnvironmentCompare do
@rest_double = double("rest")
allow(@knife).to receive(:rest).and_return(@rest_double)
- @cookbook_names = %w(apache2 mysql foo bar dummy chef_handler)
+ @cookbook_names = %w{apache2 mysql foo bar dummy chef_handler}
@base_url = "https://server.example.com/cookbooks"
@cookbook_data = {}
@cookbook_names.each do |item|
diff --git a/spec/unit/knife/node_environment_set_spec.rb b/spec/unit/knife/node_environment_set_spec.rb
index ea4112fe87..03fc764fd8 100644
--- a/spec/unit/knife/node_environment_set_spec.rb
+++ b/spec/unit/knife/node_environment_set_spec.rb
@@ -22,7 +22,7 @@ describe Chef::Knife::NodeEnvironmentSet do
before(:each) do
Chef::Config[:node_name] = "webmonkey.example.com"
@knife = Chef::Knife::NodeEnvironmentSet.new
- @knife.name_args = %w(adam bar)
+ @knife.name_args = %w{adam bar}
allow(@knife).to receive(:output).and_return(true)
@node = Chef::Node.new()
@node.name("knifetest-node")
diff --git a/spec/unit/knife/node_list_spec.rb b/spec/unit/knife/node_list_spec.rb
index fbbe6bee06..b94101ef7a 100644
--- a/spec/unit/knife/node_list_spec.rb
+++ b/spec/unit/knife/node_list_spec.rb
@@ -40,7 +40,7 @@ describe Chef::Knife::NodeList do
it "should pretty print the list" do
expect(Chef::Node).to receive(:list).and_return(@list)
- expect(@knife).to receive(:output).with(%w(bar foo))
+ expect(@knife).to receive(:output).with(%w{bar foo})
@knife.run
end
diff --git a/spec/unit/knife/node_run_list_remove_spec.rb b/spec/unit/knife/node_run_list_remove_spec.rb
index c5c7696091..4f753d7991 100644
--- a/spec/unit/knife/node_run_list_remove_spec.rb
+++ b/spec/unit/knife/node_run_list_remove_spec.rb
@@ -96,7 +96,7 @@ describe Chef::Knife::NodeRunListRemove do
it "should warn even more when the thing to remove is not in the runlist and unqualified" do
@node.run_list << "role[blah]"
@node.run_list << "recipe[duck::type]"
- @knife.name_args = %w(adam blork)
+ @knife.name_args = %w{adam blork}
expect(@knife.ui).to receive(:warn).with("blork is not in the run list")
expect(@knife.ui).to receive(:warn).with(/did you forget recipe\[\] or role\[\]/)
@knife.run
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 b843394c29..b7af9b7d57 100644
--- a/spec/unit/knife/role_env_run_list_clear_spec.rb
+++ b/spec/unit/knife/role_env_run_list_clear_spec.rb
@@ -30,7 +30,7 @@ describe Chef::Knife::RoleEnvRunListClear do
@knife.config = {
:print_after => nil
}
- @knife.name_args = %w(will QA)
+ @knife.name_args = %w{will QA}
allow(@knife).to receive(:output).and_return(true)
@role = Chef::Role.new()
@@ -79,7 +79,7 @@ describe Chef::Knife::RoleEnvRunListClear do
@setup.run
@setup.name_args = [ "will", "PRD", "recipe[orange::chicken]", "role[monkey]", "recipe[duck::type]", "role[person]", "role[bird]", "role[town]" ]
@setup.run
- @knife.name_args = %w(will QA)
+ @knife.name_args = %w{will QA}
@knife.run
expect(@role.run_list_for("QA")[0]).to be_nil
expect(@role.run_list_for("PRD")[0]).to eq("recipe[orange::chicken]")
diff --git a/spec/unit/knife/role_list_spec.rb b/spec/unit/knife/role_list_spec.rb
index b244039520..30743fdc02 100644
--- a/spec/unit/knife/role_list_spec.rb
+++ b/spec/unit/knife/role_list_spec.rb
@@ -38,7 +38,7 @@ describe Chef::Knife::RoleList do
it "should pretty print the list" do
expect(Chef::Role).to receive(:list).and_return(@list)
- expect(@knife).to receive(:output).with(%w(bar foo))
+ expect(@knife).to receive(:output).with(%w{bar foo})
@knife.run
end
diff --git a/spec/unit/knife/tag_delete_spec.rb b/spec/unit/knife/tag_delete_spec.rb
index 43f06de23f..5c932706af 100644
--- a/spec/unit/knife/tag_delete_spec.rb
+++ b/spec/unit/knife/tag_delete_spec.rb
@@ -16,7 +16,7 @@ describe Chef::Knife::TagDelete do
describe "run" do
it "can delete tags on a node" do
- expect(@node.tags).to eq(%w(sadtag happytag))
+ expect(@node.tags).to eq(%w{sadtag happytag})
@knife.run
expect(@node.tags).to eq(["happytag"])
expect(@stderr.string).to match /deleted.+sadtag/i
diff --git a/spec/unit/knife/user_create_spec.rb b/spec/unit/knife/user_create_spec.rb
index 1a5a394912..806e8cf400 100644
--- a/spec/unit/knife/user_create_spec.rb
+++ b/spec/unit/knife/user_create_spec.rb
@@ -79,7 +79,7 @@ describe Chef::Knife::UserCreate do
context "when FIRST_NAME isn't specified" do
# from spec/support/shared/unit/knife_shared.rb
it_should_behave_like "mandatory field missing" do
- let(:name_args) { %w(some_user some_display_name) }
+ let(:name_args) { %w{some_user some_display_name} }
let(:fieldname) { "first name" }
end
end
@@ -87,7 +87,7 @@ describe Chef::Knife::UserCreate do
context "when LAST_NAME isn't specified" do
# from spec/support/shared/unit/knife_shared.rb
it_should_behave_like "mandatory field missing" do
- let(:name_args) { %w(some_user some_display_name some_first_name) }
+ let(:name_args) { %w{some_user some_display_name some_first_name} }
let(:fieldname) { "last name" }
end
end
@@ -95,7 +95,7 @@ describe Chef::Knife::UserCreate do
context "when EMAIL isn't specified" do
# from spec/support/shared/unit/knife_shared.rb
it_should_behave_like "mandatory field missing" do
- let(:name_args) { %w(some_user some_display_name some_first_name some_last_name) }
+ let(:name_args) { %w{some_user some_display_name some_first_name some_last_name} }
let(:fieldname) { "email" }
end
end
@@ -103,14 +103,14 @@ describe Chef::Knife::UserCreate do
context "when PASSWORD isn't specified" do
# from spec/support/shared/unit/knife_shared.rb
it_should_behave_like "mandatory field missing" do
- let(:name_args) { %w(some_user some_display_name some_first_name some_last_name some_email) }
+ let(:name_args) { %w{some_user some_display_name some_first_name some_last_name some_email} }
let(:fieldname) { "password" }
end
end
context "when all mandatory fields are validly specified" do
before do
- knife.name_args = %w(some_user some_display_name some_first_name some_last_name some_email some_password)
+ knife.name_args = %w{some_user some_display_name some_first_name some_last_name some_email some_password}
allow(knife).to receive(:edit_data).and_return(knife.user.to_hash)
allow(knife).to receive(:create_user_from_hash).and_return(knife.user)
end
diff --git a/spec/unit/mixin/deep_merge_spec.rb b/spec/unit/mixin/deep_merge_spec.rb
index 6a9ea55d2e..2122008616 100644
--- a/spec/unit/mixin/deep_merge_spec.rb
+++ b/spec/unit/mixin/deep_merge_spec.rb
@@ -41,7 +41,7 @@ describe Chef::Mixin::DeepMerge, "deep_merge!" do
end
it "tests merging an hash w/array into blank hash" do
- hash_src = { "region" => { "id" => %w(227 2) } }
+ hash_src = { "region" => { "id" => %w{227 2} } }
hash_dst = {}
@dm.deep_merge!(hash_src, hash_dst)
expect(hash_dst).to eq(hash_src)
@@ -49,16 +49,16 @@ describe Chef::Mixin::DeepMerge, "deep_merge!" do
it "tests merge from empty hash" do
hash_src = {}
- hash_dst = { "property" => %w(2 4) }
+ hash_dst = { "property" => %w{2 4} }
@dm.deep_merge!(hash_src, hash_dst)
- expect(hash_dst).to eq({ "property" => %w(2 4) })
+ expect(hash_dst).to eq({ "property" => %w{2 4} })
end
it "tests merge to empty hash" do
- hash_src = { "property" => %w(2 4) }
+ hash_src = { "property" => %w{2 4} }
hash_dst = {}
@dm.deep_merge!(hash_src, hash_dst)
- expect(hash_dst).to eq({ "property" => %w(2 4) })
+ expect(hash_dst).to eq({ "property" => %w{2 4} })
end
it "tests simple string overwrite" do
@@ -76,36 +76,36 @@ describe Chef::Mixin::DeepMerge, "deep_merge!" do
end
it "tests hashes holding array" do
- hash_src = { "property" => %w(1 3) }
- hash_dst = { "property" => %w(2 4) }
+ hash_src = { "property" => %w{1 3} }
+ hash_dst = { "property" => %w{2 4} }
@dm.deep_merge!(hash_src, hash_dst)
- expect(hash_dst).to eq({ "property" => %w(2 4 1 3) })
+ expect(hash_dst).to eq({ "property" => %w{2 4 1 3} })
end
it "tests hashes holding hashes holding arrays (array with duplicate elements is merged with dest then src" do
- hash_src = { "property" => { "bedroom_count" => %w(1 2), "bathroom_count" => ["1", "4+"] } }
- hash_dst = { "property" => { "bedroom_count" => %w(3 2), "bathroom_count" => ["2"] } }
+ hash_src = { "property" => { "bedroom_count" => %w{1 2}, "bathroom_count" => ["1", "4+"] } }
+ hash_dst = { "property" => { "bedroom_count" => %w{3 2}, "bathroom_count" => ["2"] } }
@dm.deep_merge!(hash_src, hash_dst)
- expect(hash_dst).to eq({ "property" => { "bedroom_count" => %w(3 2 1), "bathroom_count" => ["2", "1", "4+"] } })
+ expect(hash_dst).to eq({ "property" => { "bedroom_count" => %w{3 2 1}, "bathroom_count" => ["2", "1", "4+"] } })
end
it "tests hash holding hash holding array v string (string is overwritten by array)" do
- hash_src = { "property" => { "bedroom_count" => %w(1 2), "bathroom_count" => ["1", "4+"] } }
+ hash_src = { "property" => { "bedroom_count" => %w{1 2}, "bathroom_count" => ["1", "4+"] } }
hash_dst = { "property" => { "bedroom_count" => "3", "bathroom_count" => ["2"] } }
@dm.deep_merge!(hash_src, hash_dst)
- expect(hash_dst).to eq({ "property" => { "bedroom_count" => %w(1 2), "bathroom_count" => ["2", "1", "4+"] } })
+ expect(hash_dst).to eq({ "property" => { "bedroom_count" => %w{1 2}, "bathroom_count" => ["2", "1", "4+"] } })
end
it "tests hash holding hash holding string v array (array is overwritten by string)" do
hash_src = { "property" => { "bedroom_count" => "3", "bathroom_count" => ["1", "4+"] } }
- hash_dst = { "property" => { "bedroom_count" => %w(1 2), "bathroom_count" => ["2"] } }
+ hash_dst = { "property" => { "bedroom_count" => %w{1 2}, "bathroom_count" => ["2"] } }
@dm.deep_merge!(hash_src, hash_dst)
expect(hash_dst).to eq({ "property" => { "bedroom_count" => "3", "bathroom_count" => ["2", "1", "4+"] } })
end
it "tests hash holding hash holding hash v array (array is overwritten by hash)" do
hash_src = { "property" => { "bedroom_count" => { "king_bed" => 3, "queen_bed" => 1 }, "bathroom_count" => ["1", "4+"] } }
- hash_dst = { "property" => { "bedroom_count" => %w(1 2), "bathroom_count" => ["2"] } }
+ hash_dst = { "property" => { "bedroom_count" => %w{1 2}, "bathroom_count" => ["2"] } }
@dm.deep_merge!(hash_src, hash_dst)
expect(hash_dst).to eq({ "property" => { "bedroom_count" => { "king_bed" => 3, "queen_bed" => 1 }, "bathroom_count" => ["2", "1", "4+"] } })
end
@@ -142,21 +142,21 @@ describe Chef::Mixin::DeepMerge, "deep_merge!" do
hash_src = { "property" => { "bedroom_count" => { "king_bed" => 3, "queen_bed" => [1] }, "bathroom_count" => ["1"] } }
hash_dst = { "property" => { "bedroom_count" => { "king_bed" => [2], "queen_bed" => [4] }, "bathroom_count" => ["2"] } }
@dm.deep_merge!(hash_src, hash_dst)
- expect(hash_dst).to eq({ "property" => { "bedroom_count" => { "king_bed" => 3, "queen_bed" => [4, 1] }, "bathroom_count" => %w(2 1) } })
+ expect(hash_dst).to eq({ "property" => { "bedroom_count" => { "king_bed" => 3, "queen_bed" => [4, 1] }, "bathroom_count" => %w{2 1} } })
end
it "tests 3 hash layers holding arrays of int, but source is incomplete." do
hash_src = { "property" => { "bedroom_count" => { "king_bed" => [3] }, "bathroom_count" => ["1"] } }
hash_dst = { "property" => { "bedroom_count" => { "king_bed" => [2], "queen_bed" => [4] }, "bathroom_count" => ["2"] } }
@dm.deep_merge!(hash_src, hash_dst)
- expect(hash_dst).to eq({ "property" => { "bedroom_count" => { "king_bed" => [2, 3], "queen_bed" => [4] }, "bathroom_count" => %w(2 1) } })
+ expect(hash_dst).to eq({ "property" => { "bedroom_count" => { "king_bed" => [2, 3], "queen_bed" => [4] }, "bathroom_count" => %w{2 1} } })
end
it "tests 3 hash layers holding arrays of int, but source is shorter and has new 2nd level ints." do
hash_src = { "property" => { "bedroom_count" => { 2 => 3, "king_bed" => [3] }, "bathroom_count" => ["1"] } }
hash_dst = { "property" => { "bedroom_count" => { "king_bed" => [2], "queen_bed" => [4] }, "bathroom_count" => ["2"] } }
@dm.deep_merge!(hash_src, hash_dst)
- expect(hash_dst).to eq({ "property" => { "bedroom_count" => { 2 => 3, "king_bed" => [2, 3], "queen_bed" => [4] }, "bathroom_count" => %w(2 1) } })
+ expect(hash_dst).to eq({ "property" => { "bedroom_count" => { 2 => 3, "king_bed" => [2, 3], "queen_bed" => [4] }, "bathroom_count" => %w{2 1} } })
end
it "tests 3 hash layers holding arrays of int, but source is empty" do
@@ -174,10 +174,10 @@ describe Chef::Mixin::DeepMerge, "deep_merge!" do
end
it "tests hash holding arrays of arrays" do
- hash_src = { %w(1 2 3) => %w(1 2) }
- hash_dst = { %w(4 5) => ["3"] }
+ hash_src = { %w{1 2 3} => %w{1 2} }
+ hash_dst = { %w{4 5} => ["3"] }
@dm.deep_merge!(hash_src, hash_dst)
- expect(hash_dst).to eq({ %w(1 2 3) => %w(1 2), %w(4 5) => ["3"] })
+ expect(hash_dst).to eq({ %w{1 2 3} => %w{1 2}, %w{4 5} => ["3"] })
end
it "tests merging of hash with blank hash, and make sure that source array split does not function when turned off" do
@@ -253,7 +253,7 @@ describe Chef::Mixin::DeepMerge do
it "should merge a nested hash into an empty hash" do
hash_dst = {}
- hash_src = { "region" => { "id" => %w(227 2) } }
+ hash_src = { "region" => { "id" => %w{227 2} } }
expect(@dm.merge(hash_dst, hash_src)).to eq(hash_src)
end
@@ -264,9 +264,9 @@ describe Chef::Mixin::DeepMerge do
end
it "should merge arrays within hashes" do
- hash_dst = { "property" => %w(2 4) }
- hash_src = { "property" => %w(1 3) }
- expect(@dm.merge(hash_dst, hash_src)).to eq({ "property" => %w(2 4 1 3) })
+ hash_dst = { "property" => %w{2 4} }
+ hash_src = { "property" => %w{1 3} }
+ expect(@dm.merge(hash_dst, hash_src)).to eq({ "property" => %w{2 4 1 3} })
end
it "should merge deeply nested hashes" do
@@ -276,12 +276,12 @@ describe Chef::Mixin::DeepMerge do
end
it "should not modify the source or destination during the merge" do
- hash_dst = { "property" => %w(1 2 3) }
- hash_src = { "property" => %w(4 5 6) }
+ hash_dst = { "property" => %w{1 2 3} }
+ hash_src = { "property" => %w{4 5 6} }
ret = @dm.merge(hash_dst, hash_src)
- expect(hash_dst).to eq({ "property" => %w(1 2 3) })
- expect(hash_src).to eq({ "property" => %w(4 5 6) })
- expect(ret).to eq({ "property" => %w(1 2 3 4 5 6) })
+ expect(hash_dst).to eq({ "property" => %w{1 2 3} })
+ expect(hash_src).to eq({ "property" => %w{4 5 6} })
+ expect(ret).to eq({ "property" => %w{1 2 3 4 5 6} })
end
it "should not error merging un-dupable objects" do
diff --git a/spec/unit/mixin/params_validate_spec.rb b/spec/unit/mixin/params_validate_spec.rb
index ae0cdcc803..b3bd7af159 100644
--- a/spec/unit/mixin/params_validate_spec.rb
+++ b/spec/unit/mixin/params_validate_spec.rb
@@ -144,7 +144,7 @@ describe Chef::Mixin::ParamsValidate do
{ :one => @vo },
{
:one => {
- :respond_to => %w(validate music)
+ :respond_to => %w{validate music}
}
},
)
@@ -155,7 +155,7 @@ describe Chef::Mixin::ParamsValidate do
{ :one => @vo },
{
:one => {
- :respond_to => %w(monkey validate)
+ :respond_to => %w{monkey validate}
}
},
)
diff --git a/spec/unit/mixin/properties_spec.rb b/spec/unit/mixin/properties_spec.rb
index 95babb2fe7..1af0bc7abd 100644
--- a/spec/unit/mixin/properties_spec.rb
+++ b/spec/unit/mixin/properties_spec.rb
@@ -9,8 +9,8 @@ module ChefMixinPropertiesSpec
class A
include Chef::Mixin::Properties
property :a, "a", default: "a"
- property :ab, %w(a b), default: "a"
- property :ac, %w(a c), default: "a"
+ property :ab, %w{a b}, default: "a"
+ property :ac, %w{a c}, default: "a"
end
context "and a module B with properties b, ab and bc" do
@@ -18,7 +18,7 @@ module ChefMixinPropertiesSpec
include Chef::Mixin::Properties
property :b, "b", default: "b"
property :ab, default: "b"
- property :bc, %w(b c), default: "c"
+ property :bc, %w{b c}, default: "c"
end
context "and a derived class C < A with properties c, ac and bc" do
@@ -32,22 +32,22 @@ module ChefMixinPropertiesSpec
it "A.properties has a, ab, and ac with types 'a', ['a', 'b'], and ['b', 'c']" do
expect(A.properties.keys).to eq [ :a, :ab, :ac ]
expect(A.properties[:a].validation_options[:is]).to eq "a"
- expect(A.properties[:ab].validation_options[:is]).to eq %w(a b)
- expect(A.properties[:ac].validation_options[:is]).to eq %w(a c)
+ expect(A.properties[:ab].validation_options[:is]).to eq %w{a b}
+ expect(A.properties[:ac].validation_options[:is]).to eq %w{a c}
end
it "B.properties has b, ab, and bc with types 'b', nil and ['b', 'c']" do
expect(B.properties.keys).to eq [ :b, :ab, :bc ]
expect(B.properties[:b].validation_options[:is]).to eq "b"
expect(B.properties[:ab].validation_options[:is]).to be_nil
- expect(B.properties[:bc].validation_options[:is]).to eq %w(b c)
+ expect(B.properties[:bc].validation_options[:is]).to eq %w{b c}
end
it "C.properties has a, b, c, ac and bc with merged types" do
expect(C.properties.keys).to eq [ :a, :ab, :ac, :b, :bc, :c ]
expect(C.properties[:a].validation_options[:is]).to eq "a"
expect(C.properties[:b].validation_options[:is]).to eq "b"
expect(C.properties[:c].validation_options[:is]).to eq "c"
- expect(C.properties[:ac].validation_options[:is]).to eq %w(a c)
- expect(C.properties[:bc].validation_options[:is]).to eq %w(b c)
+ expect(C.properties[:ac].validation_options[:is]).to eq %w{a c}
+ expect(C.properties[:bc].validation_options[:is]).to eq %w{b c}
end
it "C.properties has ab with a non-merged type (from B)" do
expect(C.properties[:ab].validation_options[:is]).to be_nil
diff --git a/spec/unit/mixin/template_spec.rb b/spec/unit/mixin/template_spec.rb
index 1021cbc5f3..ab7ed5bc5a 100644
--- a/spec/unit/mixin/template_spec.rb
+++ b/spec/unit/mixin/template_spec.rb
@@ -209,7 +209,7 @@ describe Chef::Mixin::Template, "render_template" do
def render_template_from_string
end
end
- %w(node render render_template render_template_from_string).each do |method_name|
+ %w{node render render_template render_template_from_string}.each do |method_name|
expect(Chef::Log).to receive(:warn).with(/^Core template method `#{method_name}' overridden by extension module/)
end
@template_context._extend_modules([mod])
diff --git a/spec/unit/mixin/windows_architecture_helper_spec.rb b/spec/unit/mixin/windows_architecture_helper_spec.rb
index 59b03b4726..4559702e1c 100644
--- a/spec/unit/mixin/windows_architecture_helper_spec.rb
+++ b/spec/unit/mixin/windows_architecture_helper_spec.rb
@@ -59,8 +59,8 @@ describe Chef::Mixin::WindowsArchitectureHelper do
it "returns true only for supported desired architecture passed to node_supports_windows_architecture" do
with_node_architecture_combinations do |node, desired_arch|
- expect(node_supports_windows_architecture?(node, desired_arch)).to be true if node_windows_architecture(node) == :x86_64 || desired_arch == :i386
- expect(node_supports_windows_architecture?(node, desired_arch)).to be false if node_windows_architecture(node) == :i386 && desired_arch == :x86_64
+ expect(node_supports_windows_architecture?(node, desired_arch)).to be true if node_windows_architecture(node) == :x86_64 || desired_arch == :i386
+ expect(node_supports_windows_architecture?(node, desired_arch)).to be false if node_windows_architecture(node) == :i386 && desired_arch == :x86_64
end
end
diff --git a/spec/unit/node/attribute_spec.rb b/spec/unit/node/attribute_spec.rb
index 4bef0f1c71..7170f62efb 100644
--- a/spec/unit/node/attribute_spec.rb
+++ b/spec/unit/node/attribute_spec.rb
@@ -29,7 +29,7 @@ describe Chef::Node::Attribute do
"platform" => "mac_os_x",
"ipaddress" => "192.168.0.117",
"network" => { "default_interface" => "en1",
- "interfaces" => { "vmnet1" => { "flags" => %w(UP BROADCAST SMART RUNNING SIMPLEX MULTICAST),
+ "interfaces" => { "vmnet1" => { "flags" => %w{UP BROADCAST SMART RUNNING SIMPLEX MULTICAST},
"number" => "1",
"addresses" => { "00:50:56:c0:00:01" => { "family" => "lladdr" },
"192.168.110.1" => { "broadcast" => "192.168.110.255",
@@ -45,7 +45,7 @@ describe Chef::Node::Attribute do
"mtu" => "1280",
"type" => "stf",
"encapsulation" => "6to4" },
- "lo0" => { "flags" => %w(UP LOOPBACK RUNNING MULTICAST),
+ "lo0" => { "flags" => %w{UP LOOPBACK RUNNING MULTICAST},
"number" => "0",
"addresses" => { "::1" => { "scope" => "Node", "prefixlen" => "128", "family" => "inet6" },
"127.0.0.1" => { "netmask" => "255.0.0.0", "family" => "inet" },
@@ -53,13 +53,13 @@ describe Chef::Node::Attribute do
"mtu" => "16384",
"type" => "lo",
"encapsulation" => "Loopback" },
- "gif0" => { "flags" => %w(POINTOPOINT MULTICAST),
+ "gif0" => { "flags" => %w{POINTOPOINT MULTICAST},
"number" => "0",
"addresses" => {},
"mtu" => "1280",
"type" => "gif",
"encapsulation" => "IPIP" },
- "vmnet8" => { "flags" => %w(UP BROADCAST SMART RUNNING SIMPLEX MULTICAST),
+ "vmnet8" => { "flags" => %w{UP BROADCAST SMART RUNNING SIMPLEX MULTICAST},
"number" => "8",
"addresses" => { "192.168.4.1" => { "broadcast" => "192.168.4.255",
"netmask" => "255.255.255.0",
@@ -70,7 +70,7 @@ describe Chef::Node::Attribute do
"arp" => { "192.168.4.255" => "ff:ff:ff:ff:ff:ff" },
"encapsulation" => "Ethernet" },
"en0" => { "status" => "inactive",
- "flags" => %w(UP BROADCAST SMART RUNNING SIMPLEX MULTICAST),
+ "flags" => %w{UP BROADCAST SMART RUNNING SIMPLEX MULTICAST},
"number" => "0",
"addresses" => { "00:23:32:b0:32:f2" => { "family" => "lladdr" } },
"mtu" => "1500",
@@ -83,7 +83,7 @@ describe Chef::Node::Attribute do
"type" => "en",
"encapsulation" => "Ethernet" },
"en1" => { "status" => "active",
- "flags" => %w(UP BROADCAST SMART RUNNING SIMPLEX MULTICAST),
+ "flags" => %w{UP BROADCAST SMART RUNNING SIMPLEX MULTICAST},
"number" => "1",
"addresses" => { "fe80::223:6cff:fe7f:676c" => { "scope" => "Link", "prefixlen" => "64", "family" => "inet6" },
"00:23:6c:7f:67:6c" => { "family" => "lladdr" },
@@ -102,7 +102,7 @@ describe Chef::Node::Attribute do
"192.168.0.152" => "0:26:8:7d:2:4c" },
"encapsulation" => "Ethernet" },
"en2" => { "status" => "active",
- "flags" => %w(UP BROADCAST SMART RUNNING SIMPLEX MULTICAST),
+ "flags" => %w{UP BROADCAST SMART RUNNING SIMPLEX MULTICAST},
"number" => "2",
"addresses" => { "169.254.206.152" => { "broadcast" => "169.254.255.255",
"netmask" => "255.255.0.0",
@@ -115,7 +115,7 @@ describe Chef::Node::Attribute do
"type" => "en",
"encapsulation" => "Ethernet" },
"fw0" => { "status" => "inactive",
- "flags" => %w(BROADCAST SIMPLEX MULTICAST),
+ "flags" => %w{BROADCAST SIMPLEX MULTICAST},
"number" => "0",
"addresses" => { "00:23:32:ff:fe:b0:32:f2" => { "family" => "lladdr" } },
"mtu" => "4078",
@@ -124,7 +124,7 @@ describe Chef::Node::Attribute do
"type" => "fw",
"encapsulation" => "1394" },
"en3" => { "status" => "active",
- "flags" => %w(UP BROADCAST SMART RUNNING SIMPLEX MULTICAST),
+ "flags" => %w{UP BROADCAST SMART RUNNING SIMPLEX MULTICAST},
"number" => "3",
"addresses" => { "169.254.206.152" => { "broadcast" => "169.254.255.255",
"netmask" => "255.255.0.0",
@@ -219,16 +219,16 @@ describe Chef::Node::Attribute do
it "gives the value at each level of precedence for a path spec" do
expected = [["set_unless_enabled?", false],
- %w(default default),
- %w(env_default env_default),
- %w(role_default role_default),
- %w(force_default force_default),
- %w(normal normal),
- %w(override override),
- %w(role_override role_override),
- %w(env_override env_override),
- %w(force_override force_override),
- %w(automatic automatic),
+ %w{default default},
+ %w{env_default env_default},
+ %w{role_default role_default},
+ %w{force_default force_default},
+ %w{normal normal},
+ %w{override override},
+ %w{role_override role_override},
+ %w{env_override env_override},
+ %w{force_override force_override},
+ %w{automatic automatic},
]
expect(@attributes.debug_value(:foo, :bar)).to eq(expected)
end
@@ -457,7 +457,7 @@ describe Chef::Node::Attribute do
hash = @attributes["foo"].to_hash
expect(hash).to eql({ "bar" => [ "fizz" ] })
hash["bar"].push("buzz")
- expect(hash).to eql({ "bar" => %w(fizz buzz) })
+ expect(hash).to eql({ "bar" => %w{fizz buzz} })
expect(@attributes.default["foo"]).to eql({ "bar" => [ "fizz" ] })
end
@@ -537,8 +537,8 @@ describe Chef::Node::Attribute do
end
it "should allow the last method to set a value if it has an = sign on the end" do
- @attributes.normal.music.mastodon = %w(dream still shining)
- expect(@attributes.normal.music.mastodon).to eq(%w(dream still shining))
+ @attributes.normal.music.mastodon = %w{dream still shining}
+ expect(@attributes.normal.music.mastodon).to eq(%w{dream still shining})
end
end
@@ -999,9 +999,9 @@ describe Chef::Node::Attribute do
it "should return a new array of k,v pairs for which the block returns true" do
expect(@attributes.select { true }.sort).to eq(
[
- %w(hut three),
- %w(one six),
- %w(snack cookies),
+ %w{hut three},
+ %w{one six},
+ %w{snack cookies},
["snakes", "on a plane"],
]
)
diff --git a/spec/unit/node_spec.rb b/spec/unit/node_spec.rb
index fae0e7eb5c..5304ac9f92 100644
--- a/spec/unit/node_spec.rb
+++ b/spec/unit/node_spec.rb
@@ -291,9 +291,9 @@ describe Chef::Node do
end
it "should let you use tag as a convience method for the tags attribute" do
- node.normal["tags"] = %w(one two)
+ node.normal["tags"] = %w{one two}
node.tag("three", "four")
- expect(node["tags"]).to eq(%w(one two three four))
+ expect(node["tags"]).to eq(%w{one two three four})
end
end
@@ -766,15 +766,15 @@ describe Chef::Node do
end
it "should overwrites the run list with the run list it consumes" do
- node.consume_run_list "recipes" => %w(one two)
+ node.consume_run_list "recipes" => %w{one two}
node.consume_run_list "recipes" => [ "three" ]
expect(node.run_list).to eq([ "three" ])
end
it "should not add duplicate recipes from the json attributes" do
node.run_list << "one"
- node.consume_run_list "recipes" => %w(one two three)
- expect(node.run_list).to eq(%w(one two three))
+ node.consume_run_list "recipes" => %w{one two three}
+ expect(node.run_list).to eq(%w{one two three})
end
it "doesn't change the run list if no run_list is specified in the json" do
@@ -887,7 +887,7 @@ describe Chef::Node do
it "sets the 'roles' automatic attribute to the expanded role list" do
@expansion.instance_variable_set(:@applied_roles, { "arf" => nil, "countersnark" => nil })
node.expand!
- expect(node.automatic_attrs[:roles].sort).to eq(%w(arf countersnark))
+ expect(node.automatic_attrs[:roles].sort).to eq(%w{arf countersnark})
end
it "applies default attributes from the environment as environment defaults" do
diff --git a/spec/unit/policy_builder/policyfile_spec.rb b/spec/unit/policy_builder/policyfile_spec.rb
index 1e19747589..40f4daaf76 100644
--- a/spec/unit/policy_builder/policyfile_spec.rb
+++ b/spec/unit/policy_builder/policyfile_spec.rb
@@ -660,7 +660,7 @@ describe Chef::PolicyBuilder::Policyfile do
expect_any_instance_of(Chef::CookbookCollection).to receive(:validate!)
run_context = policy_builder.setup_run_context
expect(run_context.node).to eq(node)
- expect(run_context.cookbook_collection.keys).to match_array(%w(example1 example2))
+ expect(run_context.cookbook_collection.keys).to match_array(%w{example1 example2})
end
it "makes the run context available via static method on Chef" do
diff --git a/spec/unit/property/validation_spec.rb b/spec/unit/property/validation_spec.rb
index ffa6a06796..db3c9fe4f6 100644
--- a/spec/unit/property/validation_spec.rb
+++ b/spec/unit/property/validation_spec.rb
@@ -292,7 +292,7 @@ describe "Chef::Resource.property validation" do
# Regex
validation_test "is: /abc/",
- %w(abc wowabcwow),
+ %w{abc wowabcwow},
[ "", "abac" ]
# Property
@@ -427,17 +427,17 @@ describe "Chef::Resource.property validation" do
:nil_is_valid
validation_test "regex: [ /abc/, /z/ ]",
- %w(xabcy aza),
+ %w{xabcy aza},
[ "gbh", 123 ],
:nil_is_valid
validation_test "regex: [ /z/, /abc/ ]",
- %w(xabcy aza),
+ %w{xabcy aza},
[ "gbh", 123 ],
:nil_is_valid
validation_test "regex: [ [ /z/, /abc/ ], [ /n/ ] ]",
- %w(xabcy aza ana),
+ %w{xabcy aza ana},
[ "gbh", 123 ],
:nil_is_valid
diff --git a/spec/unit/property_spec.rb b/spec/unit/property_spec.rb
index af014c5244..f5eb361426 100644
--- a/spec/unit/property_spec.rb
+++ b/spec/unit/property_spec.rb
@@ -985,7 +985,7 @@ describe "Chef::Resource.property" do
end
end
- %w(name_attribute name_property).each do |name|
+ %w{name_attribute name_property}.each do |name|
context "Chef::Resource::Property##{name}" do
with_property ":x, #{name}: true" do
it "defaults x to resource.name" do
diff --git a/spec/unit/provider/group/dscl_spec.rb b/spec/unit/provider/group/dscl_spec.rb
index e060e4af10..bc69d7580e 100644
--- a/spec/unit/provider/group/dscl_spec.rb
+++ b/spec/unit/provider/group/dscl_spec.rb
@@ -184,7 +184,7 @@ describe Chef::Provider::Group::Dscl do
before do
allow(@new_resource).to receive(:members).and_return([])
allow(@new_resource).to receive(:append).and_return(false)
- allow(@current_resource).to receive(:members).and_return(%w(all your base))
+ allow(@current_resource).to receive(:members).and_return(%w{all your base})
end
it "should log an appropriate message" do
@@ -201,7 +201,7 @@ describe Chef::Provider::Group::Dscl do
describe "with supplied members in the new resource" do
before do
- @new_resource.members(%w(all your base))
+ @new_resource.members(%w{all your base})
@current_resource.members([])
end
@@ -326,6 +326,6 @@ EOF
end
it "should parse members properly" do
allow(File).to receive(:exists?).and_return(true)
- expect(@current_resource.members).to eq(%w(waka bar))
+ expect(@current_resource.members).to eq(%w{waka bar})
end
end
diff --git a/spec/unit/provider/group/groupadd_spec.rb b/spec/unit/provider/group/groupadd_spec.rb
index e8b47621c4..87ab3c3493 100644
--- a/spec/unit/provider/group/groupadd_spec.rb
+++ b/spec/unit/provider/group/groupadd_spec.rb
@@ -25,12 +25,12 @@ describe Chef::Provider::Group::Groupadd, "set_options" do
@run_context = Chef::RunContext.new(@node, {}, @events)
@new_resource = Chef::Resource::Group.new("aj")
@new_resource.gid(50)
- @new_resource.members(%w(root aj))
+ @new_resource.members(%w{root aj})
@new_resource.system false
@new_resource.non_unique false
@current_resource = Chef::Resource::Group.new("aj")
@current_resource.gid(50)
- @current_resource.members(%w(root aj))
+ @current_resource.members(%w{root aj})
@current_resource.system false
@current_resource.non_unique false
@provider = Chef::Provider::Group::Groupadd.new(@new_resource, @run_context)
diff --git a/spec/unit/provider/group/pw_spec.rb b/spec/unit/provider/group/pw_spec.rb
index 250946fd1a..97ffcb3c31 100644
--- a/spec/unit/provider/group/pw_spec.rb
+++ b/spec/unit/provider/group/pw_spec.rb
@@ -26,11 +26,11 @@ describe Chef::Provider::Group::Pw do
@new_resource = Chef::Resource::Group.new("wheel")
@new_resource.gid 50
- @new_resource.members %w(root aj)
+ @new_resource.members %w{root aj}
@current_resource = Chef::Resource::Group.new("aj")
@current_resource.gid 50
- @current_resource.members %w(root aj)
+ @current_resource.members %w{root aj}
@provider = Chef::Provider::Group::Pw.new(@new_resource, @run_context)
@provider.current_resource = @current_resource
end
@@ -89,7 +89,7 @@ describe Chef::Provider::Group::Pw do
describe "with an empty members array in the new resource and existing members in the current resource" do
before do
allow(@new_resource).to receive(:members).and_return([])
- allow(@current_resource).to receive(:members).and_return(%w(all your base))
+ allow(@current_resource).to receive(:members).and_return(%w{all your base})
end
it "should log an appropriate message" do
@@ -104,7 +104,7 @@ describe Chef::Provider::Group::Pw do
describe "with supplied members array in the new resource and an empty members array in the current resource" do
before do
- allow(@new_resource).to receive(:members).and_return(%w(all your base))
+ allow(@new_resource).to receive(:members).and_return(%w{all your base})
allow(@current_resource).to receive(:members).and_return([])
end
diff --git a/spec/unit/provider/group/usermod_spec.rb b/spec/unit/provider/group/usermod_spec.rb
index 5ab5d2bce0..7bd45c4f1b 100644
--- a/spec/unit/provider/group/usermod_spec.rb
+++ b/spec/unit/provider/group/usermod_spec.rb
@@ -24,7 +24,7 @@ describe Chef::Provider::Group::Usermod do
@events = Chef::EventDispatch::Dispatcher.new
@run_context = Chef::RunContext.new(@node, {}, @events)
@new_resource = Chef::Resource::Group.new("wheel")
- @new_resource.members %w(all your base)
+ @new_resource.members %w{all your base}
@new_resource.excluded_members [ ]
@provider = Chef::Provider::Group::Usermod.new(@new_resource, @run_context)
allow(@provider).to receive(:run_command)
@@ -56,7 +56,7 @@ describe Chef::Provider::Group::Usermod do
}
before do
- allow(@new_resource).to receive(:members).and_return(%w(all your base))
+ allow(@new_resource).to receive(:members).and_return(%w{all your base})
allow(File).to receive(:exists?).and_return(true)
end
diff --git a/spec/unit/provider/group/windows_spec.rb b/spec/unit/provider/group/windows_spec.rb
index 7ff58848fa..c424e35e0e 100644
--- a/spec/unit/provider/group/windows_spec.rb
+++ b/spec/unit/provider/group/windows_spec.rb
@@ -50,7 +50,7 @@ describe Chef::Provider::Group::Windows do
before do
@new_resource.members([ "us" ])
@current_resource = Chef::Resource::Group.new("staff")
- @current_resource.members %w(all your base)
+ @current_resource.members %w{all your base}
allow(Chef::Util::Windows::NetGroup).to receive(:new).and_return(@net_group)
allow(@net_group).to receive(:local_add_members)
diff --git a/spec/unit/provider/group_spec.rb b/spec/unit/provider/group_spec.rb
index ed0537adfe..f056114d89 100644
--- a/spec/unit/provider/group_spec.rb
+++ b/spec/unit/provider/group_spec.rb
@@ -39,7 +39,7 @@ describe Chef::Provider::User do
@pw_group = double("Struct::Group",
:name => "wheel",
:gid => 20,
- :mem => %w(root aj),
+ :mem => %w{root aj},
)
allow(Etc).to receive(:getgrnam).with("wheel").and_return(@pw_group)
end
diff --git a/spec/unit/provider/mount/mount_spec.rb b/spec/unit/provider/mount/mount_spec.rb
index 4e636fba5f..52be15b2a8 100644
--- a/spec/unit/provider/mount/mount_spec.rb
+++ b/spec/unit/provider/mount/mount_spec.rb
@@ -107,7 +107,7 @@ describe Chef::Provider::Mount::Mount do
expect { @provider.load_current_resource();@provider.mountable? }.to raise_error(Chef::Exceptions::Mount)
end
- %w(tmpfs fuse cgroup).each do |fstype|
+ %w{tmpfs fuse cgroup}.each do |fstype|
it "does not expect the device to exist for #{fstype}" do
@new_resource.fstype(fstype)
@new_resource.device("whatever")
diff --git a/spec/unit/provider/mount/solaris_spec.rb b/spec/unit/provider/mount/solaris_spec.rb
index 3d5ce53619..51ace83470 100644
--- a/spec/unit/provider/mount/solaris_spec.rb
+++ b/spec/unit/provider/mount/solaris_spec.rb
@@ -316,7 +316,7 @@ describe Chef::Provider::Mount::Solaris, :unix_only do
end
it "should set the options field on the current_resource" do
- expect(provider.current_resource.options).to eql(%w(rw soft))
+ expect(provider.current_resource.options).to eql(%w{rw soft})
end
it "should set the pass field on the current_resource" do
diff --git a/spec/unit/provider/package/chocolatey_spec.rb b/spec/unit/provider/package/chocolatey_spec.rb
index 34cfec2c05..a347aa7ebd 100644
--- a/spec/unit/provider/package/chocolatey_spec.rb
+++ b/spec/unit/provider/package/chocolatey_spec.rb
@@ -95,26 +95,26 @@ munin-node|1.6.1.20130823
end
it "should set the candidate_version correctly when there are two packages to install" do
- allow_remote_list(%w(ConEmu chocolatey))
- new_resource.package_name(%w(ConEmu chocolatey))
+ allow_remote_list(%w{ConEmu chocolatey})
+ new_resource.package_name(%w{ConEmu chocolatey})
expect(provider.candidate_version).to eql(["15.10.25.1", "0.9.9.11"])
end
it "should set the candidate_version correctly when only the first is installable" do
- allow_remote_list(%w(ConEmu vim))
- new_resource.package_name(%w(ConEmu vim))
+ allow_remote_list(%w{ConEmu vim})
+ new_resource.package_name(%w{ConEmu vim})
expect(provider.candidate_version).to eql(["15.10.25.1", nil])
end
it "should set the candidate_version correctly when only the last is installable" do
- allow_remote_list(%w(vim chocolatey))
- new_resource.package_name(%w(vim chocolatey))
+ allow_remote_list(%w{vim chocolatey})
+ new_resource.package_name(%w{vim chocolatey})
expect(provider.candidate_version).to eql([nil, "0.9.9.11"])
end
it "should set the candidate_version correctly when neither are is installable" do
- allow_remote_list(%w(vim ruby))
- new_resource.package_name(%w(vim ruby))
+ allow_remote_list(%w{vim ruby})
+ new_resource.package_name(%w{vim ruby})
expect(provider.candidate_version).to eql([nil, nil])
end
end
@@ -156,25 +156,25 @@ munin-node|1.6.1.20130823
end
it "should set the current_resource.version when there are two packages that are installed" do
- new_resource.package_name(%w(ConEmu chocolatey))
+ new_resource.package_name(%w{ConEmu chocolatey})
provider.load_current_resource
expect(provider.current_resource.version).to eql(["15.10.25.0", "0.9.9.11"])
end
it "should set the current_resource.version correctly when only the first is installed" do
- new_resource.package_name(%w(ConEmu git))
+ new_resource.package_name(%w{ConEmu git})
provider.load_current_resource
expect(provider.current_resource.version).to eql(["15.10.25.0", nil])
end
it "should set the current_resource.version correctly when only the last is installed" do
- new_resource.package_name(%w(git chocolatey))
+ new_resource.package_name(%w{git chocolatey})
provider.load_current_resource
expect(provider.current_resource.version).to eql([nil, "0.9.9.11"])
end
it "should set the current_resource.version correctly when none are installed" do
- new_resource.package_name(%w(git vim))
+ new_resource.package_name(%w{git vim})
provider.load_current_resource
expect(provider.current_resource.version).to eql([nil, nil])
end
@@ -233,8 +233,8 @@ munin-node|1.6.1.20130823
# chocolatey will be pruned by the superclass out of the args to install_package and we
# implicitly test that we correctly pick up new_resource.version[1] instead of
# new_version.resource[0]
- allow_remote_list(%w(chocolatey ConEmu))
- new_resource.package_name(%w(chocolatey ConEmu))
+ allow_remote_list(%w{chocolatey ConEmu})
+ new_resource.package_name(%w{chocolatey ConEmu})
new_resource.version([nil, "15.10.25.1"])
provider.load_current_resource
expect(provider).to receive(:shell_out!).with("#{choco_exe} install -y -version 15.10.25.1 conemu", { :timeout => timeout }).and_return(double)
@@ -253,8 +253,8 @@ munin-node|1.6.1.20130823
end
it "should split up commands when given two packages, one with a version pin" do
- allow_remote_list(%w(ConEmu git))
- new_resource.package_name(%w(ConEmu git))
+ allow_remote_list(%w{ConEmu git})
+ new_resource.package_name(%w{ConEmu git})
new_resource.version(["15.10.25.1", nil])
provider.load_current_resource
expect(provider).to receive(:shell_out!).with("#{choco_exe} install -y -version 15.10.25.1 conemu", { :timeout => timeout }).and_return(double)
@@ -371,8 +371,8 @@ munin-node|1.6.1.20130823
end
it "upgrading multiple packages uses a single command" do
- allow_remote_list(%w(conemu git))
- new_resource.package_name(%w(conemu git))
+ allow_remote_list(%w{conemu git})
+ new_resource.package_name(%w{conemu git})
expect(provider).to receive(:shell_out!).with("#{choco_exe} upgrade -y conemu git", { :timeout => timeout }).and_return(double)
provider.run_action(:upgrade)
expect(new_resource).to be_updated_by_last_action
@@ -441,8 +441,8 @@ munin-node|1.6.1.20130823
it "removes a single package when its the only one installed" do
pending "this is a bug in the superclass"
- allow_remote_list(%w(git conemu))
- new_resource.package_name(%w(git conemu))
+ allow_remote_list(%w{git conemu})
+ new_resource.package_name(%w{git conemu})
provider.load_current_resource
expect(provider).to receive(:shell_out!).with("#{choco_exe} uninstall -y conemu", { :timeout => timeout }).and_return(double)
provider.run_action(:remove)
diff --git a/spec/unit/provider/package/yum_spec.rb b/spec/unit/provider/package/yum_spec.rb
index 2d4bcc6bef..2b3048bc19 100644
--- a/spec/unit/provider/package/yum_spec.rb
+++ b/spec/unit/provider/package/yum_spec.rb
@@ -987,7 +987,7 @@ describe Chef::Provider::Package::Yum::RPMUtils do
end
it "tests isalnum good input" do
- %w(a z A Z 0 9).each do |t|
+ %w{a z A Z 0 9}.each do |t|
expect(@rpmutils.isalnum(t)).to eq(true)
end
end
@@ -999,7 +999,7 @@ describe Chef::Provider::Package::Yum::RPMUtils do
end
it "tests isalpha good input" do
- %w(a z A Z).each do |t|
+ %w{a z A Z}.each do |t|
expect(@rpmutils.isalpha(t)).to eq(true)
end
end
@@ -1011,7 +1011,7 @@ describe Chef::Provider::Package::Yum::RPMUtils do
end
it "tests isdigit good input" do
- %w(0 9).each do |t|
+ %w{0 9}.each do |t|
expect(@rpmutils.isdigit(t)).to eq(true)
end
end
@@ -1119,8 +1119,8 @@ describe Chef::Provider::Package::Yum::RPMVersion do
"3.3-15.el5" ],
[ "alpha9.8",
"beta9.8" ],
- %w(14jpp
-15jpp),
+ %w{14jpp
+15jpp},
[ "0.9.0-0.6",
"0.9.0-0.7" ],
[ "0:1.9",
@@ -1297,8 +1297,8 @@ describe Chef::Provider::Package::Yum::RPMPackage do
"B-test" ],
[ "Aa-test",
"aA-test" ],
- %w(1test
-2test),
+ %w{1test
+2test},
].each do |smaller, larger|
sm = Chef::Provider::Package::Yum::RPMPackage.new(smaller, "0:0.0.1-1", "x86_64", [])
lg = Chef::Provider::Package::Yum::RPMPackage.new(larger, "0:0.0.1-1", "x86_64", [])
@@ -1310,12 +1310,12 @@ describe Chef::Provider::Package::Yum::RPMPackage do
it "should sort alphabetically based on package arch" do
[
- %w(i386
-x86_64),
- %w(i386
-noarch),
- %w(noarch
-x86_64),
+ %w{i386
+x86_64},
+ %w{i386
+noarch},
+ %w{noarch
+x86_64},
].each do |smaller, larger|
sm = Chef::Provider::Package::Yum::RPMPackage.new("test-package", "0:0.0.1-1", smaller, [])
lg = Chef::Provider::Package::Yum::RPMPackage.new("test-package", "0:0.0.1-1", larger, [])
@@ -2113,7 +2113,7 @@ describe "Chef::Provider::Package::Yum - Multi" do
@node = Chef::Node.new
@events = Chef::EventDispatch::Dispatcher.new
@run_context = Chef::RunContext.new(@node, {}, @events)
- @new_resource = Chef::Resource::Package.new(%w(cups vim))
+ @new_resource = Chef::Resource::Package.new(%w{cups vim})
@status = double("Status", :exitstatus => 0)
@yum_cache = double(
"Chef::Provider::Yum::YumCache",
@@ -2142,7 +2142,7 @@ describe "Chef::Provider::Package::Yum - Multi" do
it "should set the current resources package name to the new resources package name" do
@provider.load_current_resource
- expect(@provider.current_resource.package_name).to eq(%w(cups vim))
+ expect(@provider.current_resource.package_name).to eq(%w{cups vim})
end
it "should set the installed version to nil on the current resource if no installed package" do
@@ -2196,9 +2196,9 @@ describe "Chef::Provider::Package::Yum - Multi" do
expect(Chef::Log).to receive(:debug).exactly(1).times.with(%r{candidate version: \["1.2.4-11.18.el5_2.3", "24.4"\]})
expect(Chef::Log).to receive(:debug).at_least(2).times.with(%r{checking yum info})
@provider.load_current_resource
- expect(@provider.new_resource.package_name).to eq(%w(cups emacs))
+ expect(@provider.new_resource.package_name).to eq(%w{cups emacs})
expect(@provider.new_resource.version).to eq(["1.2.4-11.18.el5_2.3", "24.4"])
- expect(@provider.send(:package_name_array)).to eq(%w(cups emacs))
+ expect(@provider.send(:package_name_array)).to eq(%w{cups emacs})
expect(@provider.send(:new_version_array)).to eq(["1.2.4-11.18.el5_2.3", "24.4"])
end
end
@@ -2213,7 +2213,7 @@ describe "Chef::Provider::Package::Yum - Multi" do
expect(@provider).to receive(:yum_command).with(
"-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"])
+ @provider.install_package(%w{cups vim}, ["1.2.4-11.19.el5", "1.0"])
end
it "should run yum install with the package name, version and arch" do
@@ -2223,7 +2223,7 @@ describe "Chef::Provider::Package::Yum - Multi" do
expect(@provider).to receive(:yum_command).with(
"-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"])
+ @provider.install_package(%w{cups vim}, ["1.2.4-11.19.el5", "1.0"])
end
it "installs the package with the options given in the resource" do
@@ -2235,7 +2235,7 @@ describe "Chef::Provider::Package::Yum - Multi" do
"-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"])
+ @provider.install_package(%w{cups vim}, ["1.2.4-11.19.el5", "1.0"])
end
it "should run yum install with the package name and version when name has arch" do
@@ -2260,7 +2260,7 @@ describe "Chef::Provider::Package::Yum - Multi" do
expect(@provider).to receive(:yum_command).with(
"-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"])
+ @provider.install_package(%w{cups vim}, ["1.2.4-11.19.el5", "1.0"])
end
end
diff --git a/spec/unit/provider/package/zypper_spec.rb b/spec/unit/provider/package/zypper_spec.rb
index b64ef5ea93..df0a1da9a2 100644
--- a/spec/unit/provider/package/zypper_spec.rb
+++ b/spec/unit/provider/package/zypper_spec.rb
@@ -254,7 +254,7 @@ describe Chef::Provider::Package::Zypper do
shell_out_expectation!(
"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"])
+ provider.install_package(%w{emacs vim}, ["1.0", "2.0"])
end
it "should remove an array of package names and versions" do
@@ -262,7 +262,7 @@ describe Chef::Provider::Package::Zypper do
shell_out_expectation!(
"zypper --non-interactive --no-gpg-checks remove emacs=1.0 vim=2.0"
)
- provider.remove_package(%w(emacs vim), ["1.0", "2.0"])
+ provider.remove_package(%w{emacs vim}, ["1.0", "2.0"])
end
end
end
diff --git a/spec/unit/provider/package_spec.rb b/spec/unit/provider/package_spec.rb
index b2287ed8ce..9f2b019a84 100644
--- a/spec/unit/provider/package_spec.rb
+++ b/spec/unit/provider/package_spec.rb
@@ -44,7 +44,7 @@ describe Chef::Provider::Package do
end
it "raises a Chef::Exceptions::InvalidResourceSpecification if both multipackage and source are provided" do
- new_resource.package_name(%w(a b))
+ new_resource.package_name(%w{a b})
new_resource.source("foo")
expect { provider.run_action(:install) }.to raise_error(Chef::Exceptions::InvalidResourceSpecification)
end
@@ -563,8 +563,8 @@ describe "Chef::Provider::Package - Multi" do
let(:node) { Chef::Node.new }
let(:events) { Chef::EventDispatch::Dispatcher.new }
let(:run_context) { Chef::RunContext.new(node, {}, events) }
- let(:new_resource) { Chef::Resource::Package.new(%w(emacs vi)) }
- let(:current_resource) { Chef::Resource::Package.new(%w(emacs vi)) }
+ let(:new_resource) { Chef::Resource::Package.new(%w{emacs vi}) }
+ let(:current_resource) { Chef::Resource::Package.new(%w{emacs vi}) }
let(:candidate_version) { [ "1.0", "6.2" ] }
let(:provider) do
provider = Chef::Provider::Package.new(new_resource, run_context)
@@ -581,7 +581,7 @@ describe "Chef::Provider::Package - Multi" do
it "installs the candidate versions when none are installed" do
expect(provider).to receive(:install_package).with(
- %w(emacs vi),
+ %w{emacs vi},
["1.0", "6.2"],
).and_return(true)
provider.run_action(:install)
@@ -731,7 +731,7 @@ describe "Chef::Provider::Package - Multi" do
it "should remove the packages if all are installed" do
expect(provider).to be_removing_package
- expect(provider).to receive(:remove_package).with(%w(emacs vi), nil)
+ expect(provider).to receive(:remove_package).with(%w{emacs vi}, nil)
provider.run_action(:remove)
expect(new_resource).to be_updated
expect(new_resource).to be_updated_by_last_action
@@ -740,7 +740,7 @@ describe "Chef::Provider::Package - Multi" do
it "should remove the packages if some are installed" do
current_resource.version ["1.0", nil]
expect(provider).to be_removing_package
- expect(provider).to receive(:remove_package).with(%w(emacs vi), nil)
+ expect(provider).to receive(:remove_package).with(%w{emacs vi}, nil)
provider.run_action(:remove)
expect(new_resource).to be_updated
expect(new_resource).to be_updated_by_last_action
@@ -749,7 +749,7 @@ describe "Chef::Provider::Package - Multi" do
it "should remove the packages at a specific version if they are installed at that version" do
new_resource.version ["1.0", "6.2"]
expect(provider).to be_removing_package
- expect(provider).to receive(:remove_package).with(%w(emacs vi), ["1.0", "6.2"])
+ expect(provider).to receive(:remove_package).with(%w{emacs vi}, ["1.0", "6.2"])
provider.run_action(:remove)
expect(new_resource).to be_updated_by_last_action
end
@@ -757,7 +757,7 @@ describe "Chef::Provider::Package - Multi" do
it "should remove the packages at a specific version any are is installed at that version" do
new_resource.version ["0.5", "6.2"]
expect(provider).to be_removing_package
- expect(provider).to receive(:remove_package).with(%w(emacs vi), ["0.5", "6.2"])
+ expect(provider).to receive(:remove_package).with(%w{emacs vi}, ["0.5", "6.2"])
provider.run_action(:remove)
expect(new_resource).to be_updated_by_last_action
end
@@ -787,7 +787,7 @@ describe "Chef::Provider::Package - Multi" do
it "should purge the packages if all are installed" do
expect(provider).to be_removing_package
- expect(provider).to receive(:purge_package).with(%w(emacs vi), nil)
+ expect(provider).to receive(:purge_package).with(%w{emacs vi}, nil)
provider.run_action(:purge)
expect(new_resource).to be_updated
expect(new_resource).to be_updated_by_last_action
@@ -796,7 +796,7 @@ describe "Chef::Provider::Package - Multi" do
it "should purge the packages if some are installed" do
current_resource.version ["1.0", nil]
expect(provider).to be_removing_package
- expect(provider).to receive(:purge_package).with(%w(emacs vi), nil)
+ expect(provider).to receive(:purge_package).with(%w{emacs vi}, nil)
provider.run_action(:purge)
expect(new_resource).to be_updated
expect(new_resource).to be_updated_by_last_action
@@ -805,7 +805,7 @@ describe "Chef::Provider::Package - Multi" do
it "should purge the packages at a specific version if they are installed at that version" do
new_resource.version ["1.0", "6.2"]
expect(provider).to be_removing_package
- expect(provider).to receive(:purge_package).with(%w(emacs vi), ["1.0", "6.2"])
+ expect(provider).to receive(:purge_package).with(%w{emacs vi}, ["1.0", "6.2"])
provider.run_action(:purge)
expect(new_resource).to be_updated_by_last_action
end
@@ -813,7 +813,7 @@ describe "Chef::Provider::Package - Multi" do
it "should purge the packages at a specific version any are is installed at that version" do
new_resource.version ["0.5", "6.2"]
expect(provider).to be_removing_package
- expect(provider).to receive(:purge_package).with(%w(emacs vi), ["0.5", "6.2"])
+ expect(provider).to receive(:purge_package).with(%w{emacs vi}, ["0.5", "6.2"])
provider.run_action(:purge)
expect(new_resource).to be_updated_by_last_action
end
diff --git a/spec/unit/provider/service/arch_service_spec.rb b/spec/unit/provider/service/arch_service_spec.rb
index d95b020357..506a1616c5 100644
--- a/spec/unit/provider/service/arch_service_spec.rb
+++ b/spec/unit/provider/service/arch_service_spec.rb
@@ -180,7 +180,7 @@ RUNNING_PS
it "should add chef to DAEMONS array" do
allow(::File).to receive(:read).with("/etc/rc.conf").and_return("DAEMONS=(network)")
- expect(@provider).to receive(:update_daemons).with(%w(network chef))
+ expect(@provider).to receive(:update_daemons).with(%w{network chef})
@provider.enable_service()
end
end
diff --git a/spec/unit/provider/service/freebsd_service_spec.rb b/spec/unit/provider/service/freebsd_service_spec.rb
index 224ce3b026..68d4d63991 100644
--- a/spec/unit/provider/service/freebsd_service_spec.rb
+++ b/spec/unit/provider/service/freebsd_service_spec.rb
@@ -495,7 +495,7 @@ EOF
allow(provider).to receive(:service_enable_variable_name).and_return("#{new_resource.service_name}_enable")
end
- %w(start reload restart enable).each do |action|
+ %w{start reload restart enable}.each do |action|
it "should raise an exception when the action is #{action}" do
provider.define_resource_requirements
provider.action = action
@@ -503,7 +503,7 @@ EOF
end
end
- %w(stop disable).each do |action|
+ %w{stop disable}.each do |action|
it "should not raise an error when the action is #{action}" do
provider.define_resource_requirements
provider.action = action
@@ -518,7 +518,7 @@ EOF
allow(provider).to receive(:service_enable_variable_name).and_return(nil)
end
- %w(start reload restart enable).each do |action|
+ %w{start reload restart enable}.each do |action|
it "should raise an exception when the action is #{action}" do
provider.action = action
provider.define_resource_requirements
@@ -526,7 +526,7 @@ EOF
end
end
- %w(stop disable).each do |action|
+ %w{stop disable}.each do |action|
it "should not raise an error when the action is #{action}" do
provider.action = action
provider.define_resource_requirements
@@ -558,7 +558,7 @@ EOF
it "should enable the service if it is not enabled and not already specified in the rc.conf file" do
allow(current_resource).to receive(:enabled).and_return(false)
- expect(provider).to receive(:read_rc_conf).and_return(%w(foo bar))
+ expect(provider).to receive(:read_rc_conf).and_return(%w{foo bar})
expect(provider).to receive(:write_rc_conf).with(["foo", "bar", "#{new_resource.service_name}_enable=\"YES\""])
provider.enable_service()
end
diff --git a/spec/unit/provider/service/macosx_spec.rb b/spec/unit/provider/service/macosx_spec.rb
index 0828425523..12f97431ba 100644
--- a/spec/unit/provider/service/macosx_spec.rb
+++ b/spec/unit/provider/service/macosx_spec.rb
@@ -58,7 +58,7 @@ describe Chef::Provider::Service::Macosx do
</plist>
XML
- %w(Daemon Agent).each do |service_type|
+ %w{Daemon Agent}.each do |service_type|
["redis-server", "io.redis.redis-server"].each do |service_name|
["10.9", "10.10", "10.11"].each do |platform_version|
let(:plist) { "/Library/LaunchDaemons/io.redis.redis-server.plist" }
diff --git a/spec/unit/provider/service/openbsd_service_spec.rb b/spec/unit/provider/service/openbsd_service_spec.rb
index 5f5dc80b85..b11015a63a 100644
--- a/spec/unit/provider/service/openbsd_service_spec.rb
+++ b/spec/unit/provider/service/openbsd_service_spec.rb
@@ -338,7 +338,7 @@ describe Chef::Provider::Service::Openbsd do
allow(provider).to receive(:builtin_service_enable_variable_name).and_return("#{new_resource.service_name}_enable")
end
- %w(start reload restart enable).each do |action|
+ %w{start reload restart enable}.each do |action|
it "should raise an exception when the action is #{action}" do
provider.define_resource_requirements
provider.action = action
@@ -346,7 +346,7 @@ describe Chef::Provider::Service::Openbsd do
end
end
- %w(stop disable).each do |action|
+ %w{stop disable}.each do |action|
it "should not raise an error when the action is #{action}" do
provider.define_resource_requirements
provider.action = action
@@ -360,7 +360,7 @@ describe Chef::Provider::Service::Openbsd do
allow(provider).to receive(:builtin_service_enable_variable_name).and_return(nil)
end
- %w(start reload restart enable).each do |action|
+ %w{start reload restart enable}.each do |action|
it "should raise an exception when the action is #{action}" do
provider.action = action
provider.define_resource_requirements
@@ -368,7 +368,7 @@ describe Chef::Provider::Service::Openbsd do
end
end
- %w(stop disable).each do |action|
+ %w{stop disable}.each do |action|
it "should not raise an error when the action is #{action}" do
provider.action = action
provider.define_resource_requirements
diff --git a/spec/unit/provider/service/redhat_spec.rb b/spec/unit/provider/service/redhat_spec.rb
index 7023e6848a..9b878abcd6 100644
--- a/spec/unit/provider/service/redhat_spec.rb
+++ b/spec/unit/provider/service/redhat_spec.rb
@@ -150,14 +150,14 @@ describe "Chef::Provider::Service::Redhat" do
@provider.define_resource_requirements
end
- %w(start reload restart enable).each do |action|
+ %w{start reload restart enable}.each do |action|
it "should raise an error when the action is #{action}" do
@provider.action = action
expect { @provider.process_resource_requirements }.to raise_error(Chef::Exceptions::Service)
end
end
- %w(stop disable).each do |action|
+ %w{stop disable}.each do |action|
it "should not raise an error when the action is #{action}" do
@provider.action = action
expect { @provider.process_resource_requirements }.not_to raise_error
diff --git a/spec/unit/provider/user_spec.rb b/spec/unit/provider/user_spec.rb
index 6e5a469112..1cdbe462f7 100644
--- a/spec/unit/provider/user_spec.rb
+++ b/spec/unit/provider/user_spec.rb
@@ -192,13 +192,13 @@ describe Chef::Provider::User do
describe "compare_user" do
let(:mapping) {
{
- "username" => %w(adam Adam),
+ "username" => %w{adam Adam},
"comment" => ["Adam Jacob", "adam jacob"],
"uid" => [1000, 1001],
"gid" => [1000, 1001],
"home" => ["/home/adam", "/Users/adam"],
"shell" => ["/usr/bin/zsh", "/bin/bash"],
- "password" => %w(abcd 12345),
+ "password" => %w{abcd 12345},
}
}
diff --git a/spec/unit/recipe_spec.rb b/spec/unit/recipe_spec.rb
index 5a0ceda084..f9b4bd9b9c 100644
--- a/spec/unit/recipe_spec.rb
+++ b/spec/unit/recipe_spec.rb
@@ -100,7 +100,7 @@ describe Chef::Recipe do
end
end
- expect(run_context.resource_collection.map { |r| r.name }).to eql(%w(monkey dog cat))
+ expect(run_context.resource_collection.map { |r| r.name }).to eql(%w{monkey dog cat})
end
it "should return the new resource after creating it" do
diff --git a/spec/unit/resource/chocolatey_package_spec.rb b/spec/unit/resource/chocolatey_package_spec.rb
index 34874ac6b1..e43803a65f 100644
--- a/spec/unit/resource/chocolatey_package_spec.rb
+++ b/spec/unit/resource/chocolatey_package_spec.rb
@@ -42,13 +42,13 @@ describe Chef::Resource::ChocolateyPackage do
end
it "the package_name setter should accept arrays" do
- resource.package_name(%w(git unzip))
- expect(resource.package_name).to eql(%w(git unzip))
+ resource.package_name(%w{git unzip})
+ expect(resource.package_name).to eql(%w{git unzip})
end
it "the name should accept arrays" do
- resource = Chef::Resource::ChocolateyPackage.new(%w(git unzip))
- expect(resource.package_name).to eql(%w(git unzip))
+ resource = Chef::Resource::ChocolateyPackage.new(%w{git unzip})
+ expect(resource.package_name).to eql(%w{git unzip})
end
it "the default version should be nil" do
diff --git a/spec/unit/resource/cron_spec.rb b/spec/unit/resource/cron_spec.rb
index 1e3f629864..6e867b75e1 100644
--- a/spec/unit/resource/cron_spec.rb
+++ b/spec/unit/resource/cron_spec.rb
@@ -106,19 +106,19 @@ describe Chef::Resource::Cron do
end
it "should allow * for all time and date values" do
- %w(minute hour day month weekday).each do |x|
+ %w{minute hour day month weekday}.each do |x|
expect(@resource.send(x, "*")).to eql("*")
end
end
it "should allow ranges for all time and date values" do
- %w(minute hour day month weekday).each do |x|
+ %w{minute hour day month weekday}.each do |x|
expect(@resource.send(x, "1-2,5")).to eql("1-2,5")
end
end
it "should have a default value of * for all time and date values" do
- %w(minute hour day month weekday).each do |x|
+ %w{minute hour day month weekday}.each do |x|
expect(@resource.send(x)).to eql("*")
end
end
@@ -153,7 +153,7 @@ describe Chef::Resource::Cron do
end
it "should convert integer schedule values to a string" do
- %w(minute hour day month weekday).each do |x|
+ %w{minute hour day month weekday}.each do |x|
expect(@resource.send(x, 5)).to eql("5")
end
end
diff --git a/spec/unit/resource/dsc_script_spec.rb b/spec/unit/resource/dsc_script_spec.rb
index d5954119d2..4892049884 100644
--- a/spec/unit/resource/dsc_script_spec.rb
+++ b/spec/unit/resource/dsc_script_spec.rb
@@ -77,7 +77,7 @@ describe Chef::Resource::DscScript do
context "when calling imports" do
let(:module_name) { "FooModule" }
let(:module_name_b) { "BarModule" }
- let(:dsc_resources) { %w(ResourceA ResourceB) }
+ let(:dsc_resources) { %w{ResourceA ResourceB} }
it "allows an arbitrary number of resources to be set for a module to be set" do
dsc_test_resource.imports module_name, *dsc_resources
diff --git a/spec/unit/resource/group_spec.rb b/spec/unit/resource/group_spec.rb
index 40a184c08b..2bb4b57e26 100644
--- a/spec/unit/resource/group_spec.rb
+++ b/spec/unit/resource/group_spec.rb
@@ -111,8 +111,8 @@ describe Chef::Resource::Group, "members" do
end
it "(#{method}) should allow an array" do
- @resource.send(method, %w(aj adam))
- expect(@resource.send(method)).to eql( %w(aj adam) )
+ @resource.send(method, %w{aj adam})
+ expect(@resource.send(method)).to eql( %w{aj adam} )
end
it "(#{method}) should not allow a hash" do
@@ -142,12 +142,12 @@ describe Chef::Resource::Group, "append" do
describe "when it has members" do
before do
@resource.group_name("pokemon")
- @resource.members(%w(blastoise pikachu))
+ @resource.members(%w{blastoise pikachu})
end
it "describes its state" do
state = @resource.state
- expect(state[:members]).to eql(%w(blastoise pikachu))
+ expect(state[:members]).to eql(%w{blastoise pikachu})
end
it "returns the group name as its identity" do
diff --git a/spec/unit/resource/mdadm_spec.rb b/spec/unit/resource/mdadm_spec.rb
index b6f9c191b7..8eceed733e 100644
--- a/spec/unit/resource/mdadm_spec.rb
+++ b/spec/unit/resource/mdadm_spec.rb
@@ -82,14 +82,14 @@ describe Chef::Resource::Mdadm do
describe "when it has devices, level, and chunk" do
before do
@resource.raid_device("raider")
- @resource.devices(%w(device1 device2))
+ @resource.devices(%w{device1 device2})
@resource.level(1)
@resource.chunk(42)
end
it "describes its state" do
state = @resource.state
- expect(state[:devices]).to eql(%w(device1 device2))
+ expect(state[:devices]).to eql(%w{device1 device2})
expect(state[:level]).to eq(1)
expect(state[:chunk]).to eq(42)
end
diff --git a/spec/unit/resource/mount_spec.rb b/spec/unit/resource/mount_spec.rb
index 8741ac3e75..188eaa67d6 100644
--- a/spec/unit/resource/mount_spec.rb
+++ b/spec/unit/resource/mount_spec.rb
@@ -87,19 +87,19 @@ describe Chef::Resource::Mount do
end
it "should allow options attribute as an array" do
- @resource.options %w(ro nosuid)
+ @resource.options %w{ro nosuid}
expect(@resource.options).to be_a_kind_of(Array)
end
it "should allow options to be sent as a delayed evaluator" do
- @resource.options Chef::DelayedEvaluator.new { %w(rw noexec) }
- expect(@resource.options).to eql(%w(rw noexec))
+ @resource.options Chef::DelayedEvaluator.new { %w{rw noexec} }
+ expect(@resource.options).to eql(%w{rw noexec})
end
it "should allow options to be sent as a delayed evaluator, and convert to array" do
@resource.options Chef::DelayedEvaluator.new { "rw,noexec" }
expect(@resource.options).to be_a_kind_of(Array)
- expect(@resource.options).to eql(%w(rw noexec))
+ expect(@resource.options).to eql(%w{rw noexec})
end
it "should accept true for mounted" do
diff --git a/spec/unit/resource/resource_notification_spec.rb b/spec/unit/resource/resource_notification_spec.rb
index c720156cec..e141e01fcf 100644
--- a/spec/unit/resource/resource_notification_spec.rb
+++ b/spec/unit/resource/resource_notification_spec.rb
@@ -100,7 +100,7 @@ describe Chef::Resource::Notification do
end
it "raises a RuntimeError if you try to reference multiple resources" do
- notification.resource = { :cat => %w(keyboard_cat cheez_cat) }
+ notification.resource = { :cat => %w{keyboard_cat cheez_cat} }
@keyboard_cat = Chef::Resource::Cat.new("keyboard_cat")
@cheez_cat = Chef::Resource::Cat.new("cheez_cat")
@resource_collection = Chef::ResourceCollection.new
@@ -112,7 +112,7 @@ describe Chef::Resource::Notification do
end
it "raises a RuntimeError if you try to reference multiple notifying resources" do
- notification.notifying_resource = { :cat => %w(long_cat cheez_cat) }
+ notification.notifying_resource = { :cat => %w{long_cat cheez_cat} }
@long_cat = Chef::Resource::Cat.new("long_cat")
@cheez_cat = Chef::Resource::Cat.new("cheez_cat")
@resource_collection = Chef::ResourceCollection.new
diff --git a/spec/unit/resource_collection/resource_set_spec.rb b/spec/unit/resource_collection/resource_set_spec.rb
index e7b24369d7..20f6f70911 100644
--- a/spec/unit/resource_collection/resource_set_spec.rb
+++ b/spec/unit/resource_collection/resource_set_spec.rb
@@ -84,7 +84,7 @@ describe Chef::ResourceCollection::ResourceSet do
it "should find a resource by type symbol and array of names with custom names" do
collection.insert_as(zen_master, :zzz, "name1")
collection.insert_as(zen_master2, :zzz, "name2")
- check_by_names(collection.find( :zzz => %w(name1 name2)), zen_master_name, zen_master2_name)
+ check_by_names(collection.find( :zzz => %w{name1 name2}), zen_master_name, zen_master2_name)
end
it "should find resources of multiple kinds (:zen_master => a, :zen_follower => b)" do
@@ -98,7 +98,7 @@ describe Chef::ResourceCollection::ResourceSet do
collection.insert_as(zen_master, :zzz, "name1")
collection.insert_as(zen_master2, :zzz, "name2")
collection.insert_as(zen_follower, :yyy, "name3")
- check_by_names(collection.find(:zzz => %w(name1 name2), :yyy => ["name3"]),
+ check_by_names(collection.find(:zzz => %w{name1 name2}, :yyy => ["name3"]),
zen_master_name, zen_follower_name, zen_master2_name)
end
diff --git a/spec/unit/resource_collection_spec.rb b/spec/unit/resource_collection_spec.rb
index c267d85a34..a6ad895c51 100644
--- a/spec/unit/resource_collection_spec.rb
+++ b/spec/unit/resource_collection_spec.rb
@@ -171,7 +171,7 @@ describe Chef::ResourceCollection do
it "should find a resource by symbol and array of names (:zen_master => [a,b])" do
load_up_resources
- results = rc.resources(:zen_master => %w(monkey dog))
+ results = rc.resources(:zen_master => %w{monkey dog})
expect(results.length).to eql(2)
check_by_names(results, "monkey", "dog")
end
diff --git a/spec/unit/resource_spec.rb b/spec/unit/resource_spec.rb
index 64f0b72b8f..1c3a825ea1 100644
--- a/spec/unit/resource_spec.rb
+++ b/spec/unit/resource_spec.rb
@@ -205,7 +205,7 @@ describe Chef::Resource do
end
it "coerces arrays to names" do
- expect(resource.name %w(a b)).to eql("a, b")
+ expect(resource.name %w{a b}).to eql("a, b")
end
it "should coerce objects to a string" do
@@ -270,7 +270,7 @@ describe Chef::Resource do
end
it "notifies a resource with an array for its name via its prettified string name" do
- run_context.resource_collection << Chef::Resource::ZenMaster.new(%w(coffee tea))
+ run_context.resource_collection << Chef::Resource::ZenMaster.new(%w{coffee tea})
resource.notifies :reload, run_context.resource_collection.find(:zen_master => "coffee, tea")
expect(resource.delayed_notifications.detect { |e| e.resource.name == "coffee, tea" && e.action == :reload }).not_to be_nil
end
@@ -859,9 +859,9 @@ describe Chef::Resource do
it "adds mappings for multiple platforms" do
expect(Chef.resource_handler_map).to receive(:set).with(
- :energy, Chef::Resource::Klz, { platform: %w(autobots decepticons) }
+ :energy, Chef::Resource::Klz, { platform: %w{autobots decepticons} }
)
- klz.provides :energy, platform: %w(autobots decepticons)
+ klz.provides :energy, platform: %w{autobots decepticons}
end
it "adds mappings for all platforms" do
diff --git a/spec/unit/role_spec.rb b/spec/unit/role_spec.rb
index a7b329c3d6..1bbbc4c7b0 100644
--- a/spec/unit/role_spec.rb
+++ b/spec/unit/role_spec.rb
@@ -85,12 +85,12 @@ describe Chef::Role do
describe "using the old #recipes API" do
it "should let you set the recipe array" do
- expect(@role.recipes(%w(one two))).to eq(%w(one two))
+ expect(@role.recipes(%w{one two})).to eq(%w{one two})
end
it "should let you return the recipe array" do
- @role.recipes(%w(one two))
- expect(@role.recipes).to eq(%w(one two))
+ @role.recipes(%w{one two})
+ expect(@role.recipes).to eq(%w{one two})
end
it "should not list roles in the recipe array" do
diff --git a/spec/unit/run_list/run_list_expansion_spec.rb b/spec/unit/run_list/run_list_expansion_spec.rb
index d902ff6707..e1af112dbf 100644
--- a/spec/unit/run_list/run_list_expansion_spec.rb
+++ b/spec/unit/run_list/run_list_expansion_spec.rb
@@ -119,7 +119,7 @@ describe Chef::RunList::RunListExpansion do
it "has the list of all roles applied" do
# this is the correct order, but 1.8 hash order is not stable
- expect(@expansion.roles).to match_array(%w(rage mollusk))
+ expect(@expansion.roles).to match_array(%w{rage mollusk})
end
end
diff --git a/spec/unit/run_list/versioned_recipe_list_spec.rb b/spec/unit/run_list/versioned_recipe_list_spec.rb
index c5bdf4d24a..8bbd816956 100644
--- a/spec/unit/run_list/versioned_recipe_list_spec.rb
+++ b/spec/unit/run_list/versioned_recipe_list_spec.rb
@@ -43,23 +43,23 @@ describe Chef::RunList::VersionedRecipeList do
it "should append the recipe to the end of the list" do
list.add_recipe "rails"
- expect(list).to eq(%w(apt god apache2 rails))
+ expect(list).to eq(%w{apt god apache2 rails})
end
it "should not duplicate entries" do
list.add_recipe "apt"
- expect(list).to eq(%w(apt god apache2))
+ expect(list).to eq(%w{apt god apache2})
end
it "should allow you to specify a version" do
list.add_recipe "rails", "1.0.0"
- expect(list).to eq(%w(apt god apache2 rails))
+ expect(list).to eq(%w{apt god apache2 rails})
expect(list.with_versions).to include({ :name => "rails", :version => "1.0.0" })
end
it "should allow you to specify a version for a recipe that already exists" do
list.add_recipe "apt", "1.2.3"
- expect(list).to eq(%w(apt god apache2))
+ expect(list).to eq(%w{apt god apache2})
expect(list.with_versions).to include({ :name => "apt", :version => "1.2.3" })
end
diff --git a/spec/unit/run_list_spec.rb b/spec/unit/run_list_spec.rb
index cf32d0a6be..0dcd349ced 100644
--- a/spec/unit/run_list_spec.rb
+++ b/spec/unit/run_list_spec.rb
@@ -95,7 +95,7 @@ describe Chef::RunList do
it "should believe a RunList is equal to an array named after it's members" do
@run_list << "foo"
@run_list << "baz"
- expect(@run_list).to eq(%w(foo baz))
+ expect(@run_list).to eq(%w{foo baz})
end
end
@@ -199,7 +199,7 @@ describe Chef::RunList do
it "should load the role from the chef server" do
#@rest.should_receive(:get).with("roles/stubby")
expansion = @run_list.expand("_default", "server")
- expect(expansion.recipes).to eq(%w(one two kitty))
+ expect(expansion.recipes).to eq(%w{one two kitty})
end
it "should default to expanding from the server" do
diff --git a/spec/unit/search/query_spec.rb b/spec/unit/search/query_spec.rb
index d5cd698af2..b23f0277d6 100644
--- a/spec/unit/search/query_spec.rb
+++ b/spec/unit/search/query_spec.rb
@@ -30,7 +30,7 @@ describe Chef::Search::Query do
let(:filter_hash) {
{
"env" => [ "chef_environment" ],
- "ruby_plat" => %w(languages ruby platform),
+ "ruby_plat" => %w{languages ruby platform},
}
}
let(:response) {
diff --git a/spec/unit/util/backup_spec.rb b/spec/unit/util/backup_spec.rb
index 2d20021b23..8bc68ec160 100644
--- a/spec/unit/util/backup_spec.rb
+++ b/spec/unit/util/backup_spec.rb
@@ -76,7 +76,7 @@ describe Chef::Util::Backup do
end
it "should keep only 1 backup copy" do
- expect(@backup).to receive(:sorted_backup_files).and_return(%w(a b c))
+ expect(@backup).to receive(:sorted_backup_files).and_return(%w{a b c})
expect(@backup).to receive(:delete_backup).with("b")
expect(@backup).to receive(:delete_backup).with("c")
@backup.backup!
@@ -89,13 +89,13 @@ describe Chef::Util::Backup do
end
it "should not delete anything if we only have one other backup" do
- expect(@backup).to receive(:sorted_backup_files).and_return(%w(a b))
+ expect(@backup).to receive(:sorted_backup_files).and_return(%w{a b})
expect(@backup).not_to receive(:delete_backup)
@backup.backup!
end
it "should keep only 2 backup copies" do
- expect(@backup).to receive(:sorted_backup_files).and_return(%w(a b c d))
+ expect(@backup).to receive(:sorted_backup_files).and_return(%w{a b c d})
expect(@backup).to receive(:delete_backup).with("c")
expect(@backup).to receive(:delete_backup).with("d")
@backup.backup!
diff --git a/spec/unit/util/dsc/configuration_generator_spec.rb b/spec/unit/util/dsc/configuration_generator_spec.rb
index 5b739c33c0..12f62deb5a 100644
--- a/spec/unit/util/dsc/configuration_generator_spec.rb
+++ b/spec/unit/util/dsc/configuration_generator_spec.rb
@@ -151,7 +151,7 @@ describe Chef::Util::DSC::ConfigurationGenerator do
allow(File).to receive(:join) do |a, b|
[a, b].join("++")
end
- allow(Dir).to receive(:entries).with("tmp++hello") { %w(f1 f2 f3) }
+ allow(Dir).to receive(:entries).with("tmp++hello") { %w{f1 f2 f3} }
expect(conf_man.send(:find_configuration_document, "hello")).to be_nil
end
end
@@ -179,12 +179,12 @@ describe Chef::Util::DSC::ConfigurationGenerator do
end
it "should import specific resources when a module has list without * that is not empty" do
- dsc = conf_man.send(:configuration_code, "archive{}", "hello", { "FooModule" => %w(FooResource BarResource) })
+ dsc = conf_man.send(:configuration_code, "archive{}", "hello", { "FooModule" => %w{FooResource BarResource} })
expect(dsc).to match(/Import-DscResource -ModuleName FooModule -Name FooResource,BarResource/)
end
it "should import multiple modules with multiple import statements" do
- dsc = conf_man.send(:configuration_code, "archive{}", "hello", { "FooModule" => %w(FooResource BarResource), "BazModule" => [] })
+ dsc = conf_man.send(:configuration_code, "archive{}", "hello", { "FooModule" => %w{FooResource BarResource}, "BazModule" => [] })
expect(dsc).to match(/Import-DscResource -ModuleName FooModule -Name FooResource,BarResource/)
expect(dsc).to match(/Import-DscResource -ModuleName BazModule\s*\n/)
end
diff --git a/spec/unit/util/editor_spec.rb b/spec/unit/util/editor_spec.rb
index cdba502101..7a0ec91533 100644
--- a/spec/unit/util/editor_spec.rb
+++ b/spec/unit/util/editor_spec.rb
@@ -16,7 +16,7 @@ describe Chef::Util::Editor do
end
subject(:editor) { described_class.new(input_lines) }
- let(:input_lines) { %w(one two two three) }
+ let(:input_lines) { %w{one two two three} }
describe '#append_line_after' do
context "when there is no match" do
@@ -34,7 +34,7 @@ describe Chef::Util::Editor do
it("returns the number of added lines") { is_expected.to eq(2) }
it "adds a line after each match" do
execute
- expect(editor.lines).to be == %w(one two new two new three)
+ expect(editor.lines).to be == %w{one two new two new three}
end
end
@@ -51,7 +51,7 @@ describe Chef::Util::Editor do
it("returns the number of added lines") { is_expected.to eq(1) }
it "adds a line to the end" do
execute
- expect(editor.lines).to be == %w(one two two three new)
+ expect(editor.lines).to be == %w{one two two three new}
end
end
@@ -86,7 +86,7 @@ describe Chef::Util::Editor do
it("returns the number of removed lines") { is_expected.to eq(2) }
it "removes the matching lines" do
execute
- expect(editor.lines).to be == %w(one three)
+ expect(editor.lines).to be == %w{one three}
end
end
@@ -112,14 +112,14 @@ describe Chef::Util::Editor do
it("returns the number of changed lines") { is_expected.to eq(2) }
it "replaces the matching portions" do
execute
- expect(editor.lines).to be == %w(one new new three)
+ expect(editor.lines).to be == %w{one new new three}
end
end
it "matches a Regexp" do
expect(editor.replace(/^ee/, "new")).to be == 0
expect(editor.replace(/ee$/, "new")).to be == 1
- expect(editor.lines).to be == %w(one two two thrnew)
+ expect(editor.lines).to be == %w{one two two thrnew}
end
end
@@ -139,14 +139,14 @@ describe Chef::Util::Editor do
it("returns the number of replaced lines") { is_expected.to eq(2) }
it "replaces the matching line" do
execute
- expect(editor.lines).to be == %w(one new new three)
+ expect(editor.lines).to be == %w{one new new three}
end
end
it "matches a Regexp" do
expect(editor.replace_lines(/^ee/, "new")).to be == 0
expect(editor.replace_lines(/ee$/, "new")).to be == 1
- expect(editor.lines).to be == %w(one two two new)
+ expect(editor.lines).to be == %w{one two two new}
end
end
end