summaryrefslogtreecommitdiff
path: root/spec/unit
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2019-07-02 10:03:50 -0700
committerLamont Granquist <lamont@scriptkiddie.org>2019-07-02 10:04:23 -0700
commit90a74a80196725c4198b6042e8485d68c70777ac (patch)
treecddd1db0afd12a306300735538a952eff5912224 /spec/unit
parent476d2367f8b60e653289c048df6d1f4042b0753b (diff)
downloadchef-90a74a80196725c4198b6042e8485d68c70777ac.tar.gz
fixes for chefstyle bump
result of automation https://github.com/chef/chefstyle/pull/72 Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
Diffstat (limited to 'spec/unit')
-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
11 files changed, 54 insertions, 54 deletions
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