summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorTim Smith <tsmith@chef.io>2021-05-07 15:31:51 -0700
committerTim Smith <tsmith@chef.io>2021-05-07 15:31:51 -0700
commitcb0b972a45ebd3727627ed991dba6b51d85c1ef9 (patch)
tree932c15089c98226d82ccdc7a7bb0d24fca82247a /spec
parent074c5ea1b8311166bea93a3fd4e2761c13827f11 (diff)
downloadchef-cb0b972a45ebd3727627ed991dba6b51d85c1ef9.tar.gz
Resolve chefstyle warnings
Signed-off-by: Tim Smith <tsmith@chef.io>
Diffstat (limited to 'spec')
-rw-r--r--spec/functional/resource/group_spec.rb2
-rw-r--r--spec/functional/resource/link_spec.rb2
-rw-r--r--spec/functional/resource/remote_file_spec.rb2
-rw-r--r--spec/functional/resource/windows_env_spec.rb4
-rw-r--r--spec/support/chef_helpers.rb2
-rw-r--r--spec/support/shared/functional/execute_resource.rb2
-rw-r--r--spec/support/shared/unit/provider/file.rb2
-rw-r--r--spec/unit/provider/link_spec.rb2
8 files changed, 9 insertions, 9 deletions
diff --git a/spec/functional/resource/group_spec.rb b/spec/functional/resource/group_spec.rb
index a682e9c0c7..279f8ac8d4 100644
--- a/spec/functional/resource/group_spec.rb
+++ b/spec/functional/resource/group_spec.rb
@@ -72,7 +72,7 @@ describe Chef::Resource::Group, :requires_root_or_running_windows do
end
def windows_domain_user?(user_name)
- domain, user = user_name.split('\\')
+ domain, user = user_name.split("\\")
if user && domain != "."
computer_name = ENV["computername"]
diff --git a/spec/functional/resource/link_spec.rb b/spec/functional/resource/link_spec.rb
index c1de3bf99d..734897aaa4 100644
--- a/spec/functional/resource/link_spec.rb
+++ b/spec/functional/resource/link_spec.rb
@@ -84,7 +84,7 @@ describe Chef::Resource::Link do
end
def canonicalize(path)
- windows? ? path.tr("/", '\\') : path
+ windows? ? path.tr("/", "\\") : path
end
def symlink(a, b)
diff --git a/spec/functional/resource/remote_file_spec.rb b/spec/functional/resource/remote_file_spec.rb
index 09e4fdccb4..3e929d22f7 100644
--- a/spec/functional/resource/remote_file_spec.rb
+++ b/spec/functional/resource/remote_file_spec.rb
@@ -155,7 +155,7 @@ describe Chef::Resource::RemoteFile do
before do
shell_out("net.exe share #{smb_share_name} /delete")
File.write(smb_file_local_path, smb_file_content )
- shell_out!("net.exe share #{smb_share_name}=\"#{smb_share_root_directory.tr("/", '\\')}\" /grant:\"authenticated users\",read")
+ shell_out!("net.exe share #{smb_share_name}=\"#{smb_share_root_directory.tr("/", "\\")}\" /grant:\"authenticated users\",read")
end
after do
diff --git a/spec/functional/resource/windows_env_spec.rb b/spec/functional/resource/windows_env_spec.rb
index bbcbf393e2..4d77ee34bd 100644
--- a/spec/functional/resource/windows_env_spec.rb
+++ b/spec/functional/resource/windows_env_spec.rb
@@ -38,7 +38,7 @@ describe Chef::Resource::WindowsEnv, :windows_only do
if environment_variables && environment_variables.length > 0
environment_variables.each do |env|
env_obj = env.wmi_ole_object
- return env_obj if env_obj.username.split('\\').last.casecmp(test_resource.user) == 0
+ return env_obj if env_obj.username.split("\\").last.casecmp(test_resource.user) == 0
end
end
nil
@@ -93,7 +93,7 @@ describe Chef::Resource::WindowsEnv, :windows_only do
test_resource.value(env_value1)
test_resource.user(env_user)
test_resource.run_action(:create)
- expect(env_obj.username.split('\\').last.upcase).to eq(env_user)
+ expect(env_obj.username.split("\\").last.upcase).to eq(env_user)
end
context "when env variable exist with same name" do
diff --git a/spec/support/chef_helpers.rb b/spec/support/chef_helpers.rb
index 3738c4a41e..f11dee47b6 100644
--- a/spec/support/chef_helpers.rb
+++ b/spec/support/chef_helpers.rb
@@ -43,7 +43,7 @@ end
# This is a helper to canonicalize paths that we're using in the file
# tests.
def canonicalize_path(path)
- windows? ? path.tr("/", '\\') : path
+ windows? ? path.tr("/", "\\") : path
end
# Makes a temp directory with a canonical path on any platform.
diff --git a/spec/support/shared/functional/execute_resource.rb b/spec/support/shared/functional/execute_resource.rb
index 9d1c29dfac..62f3f19a2b 100644
--- a/spec/support/shared/functional/execute_resource.rb
+++ b/spec/support/shared/functional/execute_resource.rb
@@ -58,7 +58,7 @@ shared_context "a command that can be executed as an alternate user" do
include Chef::Mixin::ShellOut
before do
- shell_out!("icacls \"#{script_output_dir.tr("/", '\\')}\" /grant \"authenticated users:(F)\"")
+ shell_out!("icacls \"#{script_output_dir.tr("/", "\\")}\" /grant \"authenticated users:(F)\"")
end
after do
diff --git a/spec/support/shared/unit/provider/file.rb b/spec/support/shared/unit/provider/file.rb
index 654765e82d..dccfd5d027 100644
--- a/spec/support/shared/unit/provider/file.rb
+++ b/spec/support/shared/unit/provider/file.rb
@@ -36,7 +36,7 @@ end
# forwards-vs-reverse slashes on windows sucks
def windows_path
- windows? ? normalized_path.tr('\\', "/") : normalized_path
+ windows? ? normalized_path.tr("\\", "/") : normalized_path
end
# this is all getting a bit stupid, CHEF-4802 cut to remove all this
diff --git a/spec/unit/provider/link_spec.rb b/spec/unit/provider/link_spec.rb
index eebf0a9d07..4ab4c57094 100644
--- a/spec/unit/provider/link_spec.rb
+++ b/spec/unit/provider/link_spec.rb
@@ -41,7 +41,7 @@ describe Chef::Resource::Link do
end
def canonicalize(path)
- ChefUtils.windows? ? path.tr("/", '\\') : path
+ ChefUtils.windows? ? path.tr("/", "\\") : path
end
describe "when the target is a symlink" do