From 37e02399a6e1dd281808a556f1420f8cf6e846fd Mon Sep 17 00:00:00 2001 From: Lamont Granquist Date: Tue, 9 Feb 2016 08:17:32 -0800 Subject: autofixing auto-inserted delimiters --- spec/functional/resource/cron_spec.rb | 4 +-- spec/functional/resource/deploy_revision_spec.rb | 2 +- spec/functional/resource/git_spec.rb | 2 +- spec/functional/resource/group_spec.rb | 6 ++--- spec/functional/resource/ifconfig_spec.rb | 2 +- spec/functional/resource/mount_spec.rb | 2 +- spec/functional/resource/registry_spec.rb | 18 ++++++------- spec/functional/resource/rpm_spec.rb | 2 +- spec/functional/resource/template_spec.rb | 2 +- spec/functional/resource/user/dscl_spec.rb | 2 +- spec/functional/win32/registry_spec.rb | 32 ++++++++++++------------ spec/functional/win32/service_manager_spec.rb | 10 ++++---- 12 files changed, 42 insertions(+), 42 deletions(-) (limited to 'spec/functional') 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]) -- cgit v1.2.1