summaryrefslogtreecommitdiff
path: root/spec/support/shared/unit
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2016-02-09 07:53:56 -0800
committerLamont Granquist <lamont@scriptkiddie.org>2016-02-09 07:53:56 -0800
commitf073747786abbe6ada55ed24b696a03e39c3c45d (patch)
tree7971d871e89d522a58291713761a6c83f68e8d19 /spec/support/shared/unit
parentc6e69783705cfd48bfea0c943dc071964dd21311 (diff)
downloadchef-f073747786abbe6ada55ed24b696a03e39c3c45d.tar.gz
auto fixing some rubocops
Style/NegatedWhile Style/ParenthesesAroundCondition Style/WhileUntilDo Style/WordArray Performance/ReverseEach Style/ColonMethodCall
Diffstat (limited to 'spec/support/shared/unit')
-rw-r--r--spec/support/shared/unit/platform_introspector.rb6
-rw-r--r--spec/support/shared/unit/provider/file.rb2
-rw-r--r--spec/support/shared/unit/provider/useradd_based_user_provider.rb2
3 files changed, 5 insertions, 5 deletions
diff --git a/spec/support/shared/unit/platform_introspector.rb b/spec/support/shared/unit/platform_introspector.rb
index 2e6f74fb14..e458e1b941 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"] = { ["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?(["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?(["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/file.rb b/spec/support/shared/unit/provider/file.rb
index 5e5fc058e7..7ddd51db80 100644
--- a/spec/support/shared/unit/provider/file.rb
+++ b/spec/support/shared/unit/provider/file.rb
@@ -142,7 +142,7 @@ shared_examples_for Chef::Provider::File do
end
after do
- tempfile.close if (tempfile && !tempfile.closed?)
+ tempfile.close if tempfile && !tempfile.closed?
File.unlink(tempfile.path) rescue nil
end
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 6694aa346c..0b024b5b60 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
- ["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)