summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--spec/functional/resource/chocolatey_package_spec.rb2
-rw-r--r--spec/functional/resource/dpkg_package_spec.rb8
-rw-r--r--spec/functional/resource/dsc_script_spec.rb4
-rw-r--r--spec/unit/cookbook_version_file_specificity_spec.rb18
-rw-r--r--spec/unit/knife/key_delete_spec.rb6
-rw-r--r--spec/unit/knife/key_edit_spec.rb6
-rw-r--r--spec/unit/knife/key_show_spec.rb6
-rw-r--r--spec/unit/knife/supermarket_install_spec.rb4
-rw-r--r--spec/unit/node/attribute_spec.rb6
-rw-r--r--spec/unit/node_spec.rb2
-rw-r--r--spec/unit/provider/package/apt_spec.rb2
-rw-r--r--spec/unit/provider/package/chocolatey_spec.rb16
-rw-r--r--spec/unit/provider/package/powershell_spec.rb2
-rw-r--r--spec/unit/run_context/cookbook_compiler_spec.rb40
14 files changed, 61 insertions, 61 deletions
diff --git a/spec/functional/resource/chocolatey_package_spec.rb b/spec/functional/resource/chocolatey_package_spec.rb
index e8dae581b9..3c4b08a1f4 100644
--- a/spec/functional/resource/chocolatey_package_spec.rb
+++ b/spec/functional/resource/chocolatey_package_spec.rb
@@ -63,7 +63,7 @@ describe Chef::Resource::ChocolateyPackage, :windows_only, :choco_installed do
end
context "installing multiple packages" do
- let(:package_name) { [ "test-A", "test-B" ] }
+ let(:package_name) { %w{test-A test-B} }
it "installs both packages" do
subject.run_action(:install)
diff --git a/spec/functional/resource/dpkg_package_spec.rb b/spec/functional/resource/dpkg_package_spec.rb
index 1988fd0c7d..ef4a52017f 100644
--- a/spec/functional/resource/dpkg_package_spec.rb
+++ b/spec/functional/resource/dpkg_package_spec.rb
@@ -273,7 +273,7 @@ describe Chef::Resource::DpkgPackage, :requires_root, :debian_family_only, arch:
it "should remove both packages when called with two" do
shell_out!("dpkg -i #{test1_0} #{test2_0}")
- set_dpkg_package_name [ "chef-integration-test", "chef-integration-test2" ]
+ set_dpkg_package_name %w{chef-integration-test chef-integration-test2}
dpkg_package.run_action(action)
expect(dpkg_package).to be_updated_by_last_action
should_be_purged_or_removed("chef-integration-test")
@@ -282,7 +282,7 @@ describe Chef::Resource::DpkgPackage, :requires_root, :debian_family_only, arch:
it "should remove a package when only the first one is installed" do
shell_out!("dpkg -i #{test1_0}")
- set_dpkg_package_name [ "chef-integration-test", "chef-integration-test2" ]
+ set_dpkg_package_name %w{chef-integration-test chef-integration-test2}
dpkg_package.run_action(action)
expect(dpkg_package).to be_updated_by_last_action
should_be_purged_or_removed("chef-integration-test")
@@ -291,7 +291,7 @@ describe Chef::Resource::DpkgPackage, :requires_root, :debian_family_only, arch:
it "should remove a package when only the second one is installed" do
shell_out!("dpkg -i #{test2_0}")
- set_dpkg_package_name [ "chef-integration-test", "chef-integration-test2" ]
+ set_dpkg_package_name %w{chef-integration-test chef-integration-test2}
dpkg_package.run_action(action)
expect(dpkg_package).to be_updated_by_last_action
should_be_purged_or_removed("chef-integration-test")
@@ -299,7 +299,7 @@ describe Chef::Resource::DpkgPackage, :requires_root, :debian_family_only, arch:
end
it "should do nothing when both packages are not installed" do
- set_dpkg_package_name [ "chef-integration-test", "chef-integration-test2" ]
+ set_dpkg_package_name %w{chef-integration-test chef-integration-test2}
dpkg_package.run_action(action)
expect(dpkg_package).not_to be_updated_by_last_action
should_be_purged_or_removed("chef-integration-test")
diff --git a/spec/functional/resource/dsc_script_spec.rb b/spec/functional/resource/dsc_script_spec.rb
index 37b70598df..0808927000 100644
--- a/spec/functional/resource/dsc_script_spec.rb
+++ b/spec/functional/resource/dsc_script_spec.rb
@@ -310,7 +310,7 @@ describe Chef::Resource::DscScript, :windows_powershell_dsc_only do
it "should set a registry key according to parameters passed to the configuration" do
dsc_test_resource.configuration_name(config_name_value)
- dsc_test_resource.flags({ :"#{reg_key_name_param_name}" => test_registry_key, :"#{reg_key_value_param_name}" => test_registry_value })
+ dsc_test_resource.flags({ "#{reg_key_name_param_name}": test_registry_key, "#{reg_key_value_param_name}": test_registry_value })
expect(dsc_test_resource.registry_key_exists?(test_registry_key)).to eq(false)
dsc_test_resource.run_action(:run)
expect(dsc_test_resource.registry_key_exists?(test_registry_key)).to eq(true)
@@ -347,7 +347,7 @@ describe Chef::Resource::DscScript, :windows_powershell_dsc_only do
shared_examples_for "a dsc_script with configuration data that takes parameters" do
let(:dsc_user_code) { dsc_user_param_code }
let(:config_param_section) { config_params }
- let(:config_flags) { { :"#{dsc_user_prefix_param_name}" => (dsc_user_prefix).to_s, :"#{dsc_user_suffix_param_name}" => (dsc_user_suffix).to_s } }
+ let(:config_flags) { { "#{dsc_user_prefix_param_name}": (dsc_user_prefix).to_s, "#{dsc_user_suffix_param_name}": (dsc_user_suffix).to_s } }
it "does not directly contain the user name" do
configuration_script_content = ::File.open(dsc_test_resource.command) do |file|
file.read
diff --git a/spec/unit/cookbook_version_file_specificity_spec.rb b/spec/unit/cookbook_version_file_specificity_spec.rb
index d5ecbe4d62..4d0c8c62f1 100644
--- a/spec/unit/cookbook_version_file_specificity_spec.rb
+++ b/spec/unit/cookbook_version_file_specificity_spec.rb
@@ -371,7 +371,7 @@ describe Chef::CookbookVersion, "file specificity" do
expect(manifest_records.size).to eq(2)
checksums = manifest_records.map { |manifest_record| manifest_record[:checksum] }
- expect(checksums.sort).to eq(["csum-host-1", "csum-host-2"])
+ expect(checksums.sort).to eq(%w{csum-host-1 csum-host-2})
end
it "should return a directory of manifest records based on priority preference: platform & full version" do
@@ -385,7 +385,7 @@ describe Chef::CookbookVersion, "file specificity" do
expect(manifest_records.size).to eq(2)
checksums = manifest_records.map { |manifest_record| manifest_record[:checksum] }
- expect(checksums.sort).to eq(["csum-platver-full-1", "csum-platver-full-2"])
+ expect(checksums.sort).to eq(%w{csum-platver-full-1 csum-platver-full-2})
end
it "should return a directory of manifest records based on priority preference: platform & partial version" do
@@ -399,7 +399,7 @@ describe Chef::CookbookVersion, "file specificity" do
expect(manifest_records.size).to eq(2)
checksums = manifest_records.map { |manifest_record| manifest_record[:checksum] }
- expect(checksums.sort).to eq(["csum-platver-partial-1", "csum-platver-partial-2"])
+ expect(checksums.sort).to eq(%w{csum-platver-partial-1 csum-platver-partial-2})
end
it "should return a directory of manifest records based on priority preference: platform only" do
@@ -413,7 +413,7 @@ describe Chef::CookbookVersion, "file specificity" do
expect(manifest_records.size).to eq(2)
checksums = manifest_records.map { |manifest_record| manifest_record[:checksum] }
- expect(checksums.sort).to eq(["csum-plat-1", "csum-plat-2"])
+ expect(checksums.sort).to eq(%w{csum-plat-1 csum-plat-2})
end
it "should return a directory of manifest records based on priority preference: default" do
@@ -427,7 +427,7 @@ describe Chef::CookbookVersion, "file specificity" do
expect(manifest_records.size).to eq(2)
checksums = manifest_records.map { |manifest_record| manifest_record[:checksum] }
- expect(checksums.sort).to eq(["csum-default-1", "csum-default-2"])
+ expect(checksums.sort).to eq(%w{csum-default-1 csum-default-2})
end
it "should return a manifest record based on priority preference: platform & full version - platform_version variant 1" do
@@ -441,7 +441,7 @@ describe Chef::CookbookVersion, "file specificity" do
expect(manifest_records.size).to eq(2)
checksums = manifest_records.map { |manifest_record| manifest_record[:checksum] }
- expect(checksums.sort).to eq(["csum2-platver-full-1", "csum2-platver-full-2"])
+ expect(checksums.sort).to eq(%w{csum2-platver-full-1 csum2-platver-full-2})
end
it "should return a manifest record based on priority preference: platform & partial version - platform_version variant 1" do
@@ -455,7 +455,7 @@ describe Chef::CookbookVersion, "file specificity" do
expect(manifest_records.size).to eq(2)
checksums = manifest_records.map { |manifest_record| manifest_record[:checksum] }
- expect(checksums.sort).to eq(["csum2-platver-partial-1", "csum2-platver-partial-2"])
+ expect(checksums.sort).to eq(%w{csum2-platver-partial-1 csum2-platver-partial-2})
end
it "should return a manifest record based on priority preference: platform & full version - platform_version variant 2" do
@@ -469,7 +469,7 @@ describe Chef::CookbookVersion, "file specificity" do
expect(manifest_records.size).to eq(2)
checksums = manifest_records.map { |manifest_record| manifest_record[:checksum] }
- expect(checksums.sort).to eq(["csum3-platver-full-1", "csum3-platver-full-2"])
+ expect(checksums.sort).to eq(%w{csum3-platver-full-1 csum3-platver-full-2})
end
it "should return a manifest record based on priority preference: platform & full version - platform_version variant 3" do
@@ -483,7 +483,7 @@ describe Chef::CookbookVersion, "file specificity" do
expect(manifest_records.size).to eq(2)
checksums = manifest_records.map { |manifest_record| manifest_record[:checksum] }
- expect(checksums.sort).to eq(["csum4-platver-full-1", "csum4-platver-full-2"])
+ expect(checksums.sort).to eq(%w{csum4-platver-full-1 csum4-platver-full-2})
end
end
diff --git a/spec/unit/knife/key_delete_spec.rb b/spec/unit/knife/key_delete_spec.rb
index 87969198dc..a22b30cf61 100644
--- a/spec/unit/knife/key_delete_spec.rb
+++ b/spec/unit/knife/key_delete_spec.rb
@@ -37,7 +37,7 @@ describe "key delete commands that inherit knife" do
end
context "after apply_params! is called with valid args" do
- let(:params) { ["charmander", "charmander-key"] }
+ let(:params) { %w{charmander charmander-key} }
before do
command.apply_params!(params)
end
@@ -59,7 +59,7 @@ describe "key delete commands that inherit knife" do
it_should_behave_like "a knife key command with a keyname as the second arg"
it_should_behave_like "a knife key command" do
let(:service_object) { instance_double(Chef::Knife::KeyDelete) }
- let(:params) { ["charmander", "charmander-key"] }
+ let(:params) { %w{charmander charmander-key} }
end
end
@@ -69,7 +69,7 @@ describe "key delete commands that inherit knife" do
it_should_behave_like "a knife key command with a keyname as the second arg"
it_should_behave_like "a knife key command" do
let(:service_object) { instance_double(Chef::Knife::KeyDelete) }
- let(:params) { ["charmander", "charmander-key"] }
+ let(:params) { %w{charmander charmander-key} }
end
end
end
diff --git a/spec/unit/knife/key_edit_spec.rb b/spec/unit/knife/key_edit_spec.rb
index 1650386da6..7c409f5ea0 100644
--- a/spec/unit/knife/key_edit_spec.rb
+++ b/spec/unit/knife/key_edit_spec.rb
@@ -37,7 +37,7 @@ describe "key edit commands that inherit knife" do
end
context "after apply_params! is called with valid args" do
- let(:params) { ["charmander", "charmander-key"] }
+ let(:params) { %w{charmander charmander-key} }
before do
command.apply_params!(params)
end
@@ -59,7 +59,7 @@ describe "key edit commands that inherit knife" do
it_should_behave_like "a knife key command with a keyname as the second arg"
it_should_behave_like "a knife key command" do
let(:service_object) { instance_double(Chef::Knife::KeyEdit) }
- let(:params) { ["charmander", "charmander-key"] }
+ let(:params) { %w{charmander charmander-key} }
end
end
@@ -69,7 +69,7 @@ describe "key edit commands that inherit knife" do
it_should_behave_like "a knife key command with a keyname as the second arg"
it_should_behave_like "a knife key command" do
let(:service_object) { instance_double(Chef::Knife::KeyEdit) }
- let(:params) { ["charmander", "charmander-key"] }
+ let(:params) { %w{charmander charmander-key} }
end
end
end
diff --git a/spec/unit/knife/key_show_spec.rb b/spec/unit/knife/key_show_spec.rb
index f2eb244b23..83ddb4d6aa 100644
--- a/spec/unit/knife/key_show_spec.rb
+++ b/spec/unit/knife/key_show_spec.rb
@@ -37,7 +37,7 @@ describe "key show commands that inherit knife" do
end
context "after apply_params! is called with valid args" do
- let(:params) { ["charmander", "charmander-key"] }
+ let(:params) { %w{charmander charmander-key} }
before do
command.apply_params!(params)
end
@@ -59,7 +59,7 @@ describe "key show commands that inherit knife" do
it_should_behave_like "a knife key command with a keyname as the second arg"
it_should_behave_like "a knife key command" do
let(:service_object) { instance_double(Chef::Knife::KeyShow) }
- let(:params) { ["charmander", "charmander-key"] }
+ let(:params) { %w{charmander charmander-key} }
end
end
@@ -69,7 +69,7 @@ describe "key show commands that inherit knife" do
it_should_behave_like "a knife key command with a keyname as the second arg"
it_should_behave_like "a knife key command" do
let(:service_object) { instance_double(Chef::Knife::KeyShow) }
- let(:params) { ["charmander", "charmander-key"] }
+ let(:params) { %w{charmander charmander-key} }
end
end
end
diff --git a/spec/unit/knife/supermarket_install_spec.rb b/spec/unit/knife/supermarket_install_spec.rb
index 68c8af1028..d891de9268 100644
--- a/spec/unit/knife/supermarket_install_spec.rb
+++ b/spec/unit/knife/supermarket_install_spec.rb
@@ -81,7 +81,7 @@ describe Chef::Knife::SupermarketInstall do
end
it "raises an error if the second argument is not a version" do
- knife.name_args = ["getting-started", "1pass"]
+ knife.name_args = %w{getting-started 1pass}
expect(knife.ui).to receive(:error).with("Installing multiple cookbooks at once is not supported.")
expect { knife.run }.to raise_error(SystemExit)
end
@@ -93,7 +93,7 @@ describe Chef::Knife::SupermarketInstall do
end
it "raises an error if the second argument is a one-digit version" do
- knife.name_args = ["getting-started", "1"]
+ knife.name_args = %w{getting-started 1}
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/node/attribute_spec.rb b/spec/unit/node/attribute_spec.rb
index 1e311bfe49..29e299566b 100644
--- a/spec/unit/node/attribute_spec.rb
+++ b/spec/unit/node/attribute_spec.rb
@@ -80,9 +80,9 @@ describe Chef::Node::Attribute do
"mtu" => "1500",
"media" => { "supported" => { "autoselect" => { "options" => [] },
"none" => { "options" => [] },
- "1000baseT" => { "options" => ["full-duplex", "flow-control", "hw-loopback"] },
- "10baseT/UTP" => { "options" => ["half-duplex", "full-duplex", "flow-control", "hw-loopback"] },
- "100baseTX" => { "options" => ["half-duplex", "full-duplex", "flow-control", "hw-loopback"] } },
+ "1000baseT" => { "options" => %w{full-duplex flow-control hw-loopback} },
+ "10baseT/UTP" => { "options" => %w{half-duplex full-duplex flow-control hw-loopback} },
+ "100baseTX" => { "options" => %w{half-duplex full-duplex flow-control hw-loopback} } },
"selected" => { "autoselect" => { "options" => [] } } },
"type" => "en",
"encapsulation" => "Ethernet" },
diff --git a/spec/unit/node_spec.rb b/spec/unit/node_spec.rb
index 3225f912dc..2d28a3e961 100644
--- a/spec/unit/node_spec.rb
+++ b/spec/unit/node_spec.rb
@@ -1188,7 +1188,7 @@ describe Chef::Node do
expect(node.name).to eql("test.example.com-short")
expect(node["sunshine"]).to eql("in")
expect(node["something"]).to eql("else")
- expect(node.run_list).to eq(["operations-master", "operations-monitoring"])
+ expect(node.run_list).to eq(%w{operations-master operations-monitoring})
end
it "should raise an exception if the file cannot be found or read" do
diff --git a/spec/unit/provider/package/apt_spec.rb b/spec/unit/provider/package/apt_spec.rb
index 31b37f5094..bfc78cbb7f 100644
--- a/spec/unit/provider/package/apt_spec.rb
+++ b/spec/unit/provider/package/apt_spec.rb
@@ -586,7 +586,7 @@ describe Chef::Provider::Package::Apt do
env: { "DEBIAN_FRONTEND" => "noninteractive" },
timeout: @timeout
)
- @provider.install_package(["libmysqlclient15-dev", "irssi"], ["not_a_real_version", "0.8.12-7"])
+ @provider.install_package(%w{libmysqlclient15-dev irssi}, ["not_a_real_version", "0.8.12-7"])
end
end
diff --git a/spec/unit/provider/package/chocolatey_spec.rb b/spec/unit/provider/package/chocolatey_spec.rb
index ac800212d8..9b0cef4ef3 100644
--- a/spec/unit/provider/package/chocolatey_spec.rb
+++ b/spec/unit/provider/package/chocolatey_spec.rb
@@ -262,8 +262,8 @@ describe Chef::Provider::Package::Chocolatey do
end
it "should do multipackage installs when given two packages without constraints" do
- allow_remote_list(["git", "munin-node"])
- new_resource.package_name(["git", "munin-node"])
+ allow_remote_list(%w{git munin-node})
+ new_resource.package_name(%w{git munin-node})
provider.load_current_resource
expect(provider).to receive(:shell_out_compacted!).with("#{choco_exe} install -y git munin-node", { returns: [0], timeout: timeout }).and_return(double)
provider.run_action(:install)
@@ -298,8 +298,8 @@ describe Chef::Provider::Package::Chocolatey do
end
it "installing multiple packages with a package that does not exist throws an error" do
- allow_remote_list(["git", "package-does-not-exist"])
- new_resource.package_name(["git", "package-does-not-exist"])
+ allow_remote_list(%w{git package-does-not-exist})
+ new_resource.package_name(%w{git package-does-not-exist})
provider.load_current_resource
expect { provider.run_action(:install) }.to raise_error(Chef::Exceptions::Package)
end
@@ -405,8 +405,8 @@ describe Chef::Provider::Package::Chocolatey do
end
it "upgrading multiple packages with a package that does not exist throws an error" do
- allow_remote_list(["git", "package-does-not-exist"])
- new_resource.package_name(["git", "package-does-not-exist"])
+ allow_remote_list(%w{git package-does-not-exist})
+ new_resource.package_name(%w{git package-does-not-exist})
provider.load_current_resource
expect { provider.run_action(:upgrade) }.to raise_error(Chef::Exceptions::Package)
end
@@ -432,8 +432,8 @@ describe Chef::Provider::Package::Chocolatey do
end
it "does nothing when all the packages are already removed" do
- allow_remote_list(["git", "package-does-not-exist"])
- new_resource.package_name(["git", "package-does-not-exist"])
+ allow_remote_list(%w{git package-does-not-exist})
+ new_resource.package_name(%w{git package-does-not-exist})
provider.load_current_resource
expect(provider).not_to receive(:remove_package)
provider.run_action(:remove)
diff --git a/spec/unit/provider/package/powershell_spec.rb b/spec/unit/provider/package/powershell_spec.rb
index c7a16acaa2..e4adc402cb 100644
--- a/spec/unit/provider/package/powershell_spec.rb
+++ b/spec/unit/provider/package/powershell_spec.rb
@@ -198,7 +198,7 @@ describe Chef::Provider::Package::Powershell do
end
it "can build a valid command from an array" do
- expect(provider.build_powershell_package_command(["Get-Package", "posh-git"])).to eql(generated_command)
+ expect(provider.build_powershell_package_command(%w{Get-Package posh-git})).to eql(generated_command)
end
context "when source is nil" do
diff --git a/spec/unit/run_context/cookbook_compiler_spec.rb b/spec/unit/run_context/cookbook_compiler_spec.rb
index 3c585cf444..607333416d 100644
--- a/spec/unit/run_context/cookbook_compiler_spec.rb
+++ b/spec/unit/run_context/cookbook_compiler_spec.rb
@@ -115,11 +115,11 @@ describe Chef::RunContext::CookbookCompiler do
node.run_list("test-with-deps::default", "test-with-circular-deps::default")
compiler.compile_libraries
- expect(LibraryLoadOrder.load_order).to eq(["dependency1", "dependency2", "test-with-deps", "circular-dep2", "circular-dep1", "test-with-circular-deps"])
+ expect(LibraryLoadOrder.load_order).to eq(%w{dependency1 dependency2 test-with-deps circular-dep2 circular-dep1 test-with-circular-deps})
# additionally test that we only load them once
compiler.compile_libraries
- expect(LibraryLoadOrder.load_order).to eq(["dependency1", "dependency2", "test-with-deps", "circular-dep2", "circular-dep1", "test-with-circular-deps"])
+ expect(LibraryLoadOrder.load_order).to eq(%w{dependency1 dependency2 test-with-deps circular-dep2 circular-dep1 test-with-circular-deps})
end
end
@@ -133,18 +133,18 @@ describe Chef::RunContext::CookbookCompiler do
node.run_list("test-with-deps::default", "test-with-circular-deps::default")
compiler.compile_lwrps
- expect(LibraryLoadOrder.load_order).to eq(["dependency1-provider",
- "dependency1-resource",
- "dependency2-provider",
- "dependency2-resource",
- "test-with-deps-provider",
- "test-with-deps-resource",
- "circular-dep2-provider",
- "circular-dep2-resource",
- "circular-dep1-provider",
- "circular-dep1-resource",
- "test-with-circular-deps-provider",
- "test-with-circular-deps-resource"])
+ expect(LibraryLoadOrder.load_order).to eq(%w{dependency1-provider
+ dependency1-resource
+ dependency2-provider
+ dependency2-resource
+ test-with-deps-provider
+ test-with-deps-resource
+ circular-dep2-provider
+ circular-dep2-resource
+ circular-dep1-provider
+ circular-dep1-resource
+ test-with-circular-deps-provider
+ test-with-circular-deps-resource})
end
end
@@ -159,12 +159,12 @@ describe Chef::RunContext::CookbookCompiler do
node.run_list("test-with-deps::default", "test-with-circular-deps::default")
compiler.compile_resource_definitions
- expect(LibraryLoadOrder.load_order).to eq(["dependency1-definition",
- "dependency2-definition",
- "test-with-deps-definition",
- "circular-dep2-definition",
- "circular-dep1-definition",
- "test-with-circular-deps-definition"])
+ expect(LibraryLoadOrder.load_order).to eq(%w{dependency1-definition
+ dependency2-definition
+ test-with-deps-definition
+ circular-dep2-definition
+ circular-dep1-definition
+ test-with-circular-deps-definition})
end
end