summaryrefslogtreecommitdiff
path: root/spec/functional
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2019-07-05 12:58:00 -0700
committerLamont Granquist <lamont@scriptkiddie.org>2019-07-05 12:58:00 -0700
commit2a4916b7f01940d1199c35645c1b2172f5bd74b2 (patch)
treedf7370ed682895857181f14bb66cad8db18b298e /spec/functional
parent8215091264d67d81f0da9a13f968b864ff736cb2 (diff)
downloadchef-2a4916b7f01940d1199c35645c1b2172f5bd74b2.tar.gz
Style/StringLiteralsInInterpolation
since we use double quotes, be consistent everywhere. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
Diffstat (limited to 'spec/functional')
-rw-r--r--spec/functional/knife/ssh_spec.rb4
-rw-r--r--spec/functional/rebooter_spec.rb2
-rwxr-xr-xspec/functional/resource/aix_service_spec.rb2
-rwxr-xr-xspec/functional/resource/aixinit_service_spec.rb2
-rw-r--r--spec/functional/resource/chocolatey_package_spec.rb2
-rw-r--r--spec/functional/resource/dsc_script_spec.rb6
-rw-r--r--spec/functional/resource/mount_spec.rb2
-rw-r--r--spec/functional/resource/powershell_script_spec.rb14
-rw-r--r--spec/functional/resource/remote_file_spec.rb2
-rw-r--r--spec/functional/resource/user/windows_spec.rb4
-rw-r--r--spec/functional/resource/windows_service_spec.rb4
-rw-r--r--spec/functional/util/powershell/cmdlet_spec.rb2
12 files changed, 23 insertions, 23 deletions
diff --git a/spec/functional/knife/ssh_spec.rb b/spec/functional/knife/ssh_spec.rb
index 929c4dc693..aade00cbf1 100644
--- a/spec/functional/knife/ssh_spec.rb
+++ b/spec/functional/knife/ssh_spec.rb
@@ -301,7 +301,7 @@ describe Chef::Knife::Ssh do
end
it "uses the ssh_gateway_identity file" do
- expect(@knife.session).to receive(:via).with("ec2.public_hostname", "user", { keys: File.expand_path("#{ENV['HOME']}/.ssh/aws-gateway.rsa").squeeze("/"), keys_only: true })
+ expect(@knife.session).to receive(:via).with("ec2.public_hostname", "user", { keys: File.expand_path("#{ENV["HOME"]}/.ssh/aws-gateway.rsa").squeeze("/"), keys_only: true })
@knife.run
expect(@knife.config[:ssh_gateway_identity]).to eq("~/.ssh/aws-gateway.rsa")
end
@@ -315,7 +315,7 @@ describe Chef::Knife::Ssh do
end
it "uses the ssh_gateway_identity file" do
- expect(@knife.session).to receive(:via).with("ec2.public_hostname", "user", { keys: File.expand_path("#{ENV['HOME']}/.ssh/aws-gateway.rsa").squeeze("/"), keys_only: true })
+ expect(@knife.session).to receive(:via).with("ec2.public_hostname", "user", { keys: File.expand_path("#{ENV["HOME"]}/.ssh/aws-gateway.rsa").squeeze("/"), keys_only: true })
@knife.run
expect(@knife.config[:ssh_gateway_identity]).to eq("~/.ssh/aws-gateway.rsa")
end
diff --git a/spec/functional/rebooter_spec.rb b/spec/functional/rebooter_spec.rb
index 8e5b23f86b..747978cc96 100644
--- a/spec/functional/rebooter_spec.rb
+++ b/spec/functional/rebooter_spec.rb
@@ -44,7 +44,7 @@ describe Chef::Platform::Rebooter do
let(:expected) do
{
- windows: "#{ENV['SYSTEMROOT']}/System32/shutdown.exe /r /t 300 /c \"rebooter spec test\"",
+ windows: "#{ENV["SYSTEMROOT"]}/System32/shutdown.exe /r /t 300 /c \"rebooter spec test\"",
linux: 'shutdown -r +5 "rebooter spec test" &',
solaris: 'shutdown -i6 -g5 -y "rebooter spec test" &',
}
diff --git a/spec/functional/resource/aix_service_spec.rb b/spec/functional/resource/aix_service_spec.rb
index 5fff3e00d7..9ffe05266d 100755
--- a/spec/functional/resource/aix_service_spec.rb
+++ b/spec/functional/resource/aix_service_spec.rb
@@ -77,7 +77,7 @@ describe Chef::Resource::Service, :requires_root, :aix_only do
include Chef::Mixin::ShellOut
def get_user_id
- shell_out("id -u #{ENV['USER']}").stdout.chomp
+ shell_out("id -u #{ENV["USER"]}").stdout.chomp
end
describe "When service is a subsystem" do
diff --git a/spec/functional/resource/aixinit_service_spec.rb b/spec/functional/resource/aixinit_service_spec.rb
index 68ea5ab8b2..fc8a80eb08 100755
--- a/spec/functional/resource/aixinit_service_spec.rb
+++ b/spec/functional/resource/aixinit_service_spec.rb
@@ -40,7 +40,7 @@ describe Chef::Resource::Service, :requires_root, :aix_only do
directory = []
if priority.is_a? Hash
priority.each do |level, o|
- directory << "/etc/rc.d/rc#{level}.d/#{(o[0] == :start ? 'S' : 'K')}#{o[1]}#{new_resource.service_name}"
+ directory << "/etc/rc.d/rc#{level}.d/#{(o[0] == :start ? "S" : "K")}#{o[1]}#{new_resource.service_name}"
end
directory
else
diff --git a/spec/functional/resource/chocolatey_package_spec.rb b/spec/functional/resource/chocolatey_package_spec.rb
index 3c4b08a1f4..c5590b2d88 100644
--- a/spec/functional/resource/chocolatey_package_spec.rb
+++ b/spec/functional/resource/chocolatey_package_spec.rb
@@ -22,7 +22,7 @@ describe Chef::Resource::ChocolateyPackage, :windows_only, :choco_installed do
include Chef::Mixin::PowershellOut
let(:package_name) { "test-A" }
- let(:package_list) { proc { powershell_out!("choco list -lo -r #{Array(package_name).join(' ')}").stdout.chomp } }
+ let(:package_list) { proc { powershell_out!("choco list -lo -r #{Array(package_name).join(" ")}").stdout.chomp } }
let(:package_source) { File.join(CHEF_SPEC_ASSETS, "chocolatey_feed") }
subject do
diff --git a/spec/functional/resource/dsc_script_spec.rb b/spec/functional/resource/dsc_script_spec.rb
index 0808927000..8488fe09ed 100644
--- a/spec/functional/resource/dsc_script_spec.rb
+++ b/spec/functional/resource/dsc_script_spec.rb
@@ -184,8 +184,8 @@ describe Chef::Resource::DscScript, :windows_powershell_dsc_only do
end
let(:dsc_environment_env_var_name) { "dsc_test_cwd" }
- let(:dsc_environment_no_fail_not_etc_directory) { "#{ENV['systemroot']}\\system32" }
- let(:dsc_environment_fail_etc_directory) { "#{ENV['systemroot']}\\system32\\drivers\\etc" }
+ let(:dsc_environment_no_fail_not_etc_directory) { "#{ENV["systemroot"]}\\system32" }
+ let(:dsc_environment_fail_etc_directory) { "#{ENV["systemroot"]}\\system32\\drivers\\etc" }
let(:exception_message_signature) { "LL927-LL928" }
let(:dsc_environment_config) do
<<~EOH
@@ -464,7 +464,7 @@ describe Chef::Resource::DscScript, :windows_powershell_dsc_only do
User dsctestusercreate
{
UserName = '#{dsc_user}'
- Password = #{r.ps_credential('jf9a8m49jrajf4#')}
+ Password = #{r.ps_credential("jf9a8m49jrajf4#")}
Ensure = "Present"
}
EOF
diff --git a/spec/functional/resource/mount_spec.rb b/spec/functional/resource/mount_spec.rb
index f6c7f91bcd..6dd9f54412 100644
--- a/spec/functional/resource/mount_spec.rb
+++ b/spec/functional/resource/mount_spec.rb
@@ -73,7 +73,7 @@ describe Chef::Resource::Mount, :requires_root, :skip_travis, external: include_
def mount_should_exist(mount_point, device, fstype = nil, options = nil)
validation_cmd = "mount | grep #{mount_point} | grep #{device} "
validation_cmd << " | grep #{fstype} " unless fstype.nil?
- validation_cmd << " | grep #{options.join(',')} " unless options.nil? || options.empty?
+ validation_cmd << " | grep #{options.join(",")} " unless options.nil? || options.empty?
expect(shell_out(validation_cmd).exitstatus).to eq(0)
end
diff --git a/spec/functional/resource/powershell_script_spec.rb b/spec/functional/resource/powershell_script_spec.rb
index 850c273a6c..4473b242c4 100644
--- a/spec/functional/resource/powershell_script_spec.rb
+++ b/spec/functional/resource/powershell_script_spec.rb
@@ -28,13 +28,13 @@ describe Chef::Resource::WindowsScript::PowershellScript, :windows_only do
it_behaves_like "a Windows script running on Windows"
- let(:successful_executable_script_content) { "#{ENV['SystemRoot']}\\system32\\attrib.exe $env:systemroot" }
- let(:failed_executable_script_content) { "#{ENV['SystemRoot']}\\system32\\attrib.exe /badargument" }
+ let(:successful_executable_script_content) { "#{ENV["SystemRoot"]}\\system32\\attrib.exe $env:systemroot" }
+ let(:failed_executable_script_content) { "#{ENV["SystemRoot"]}\\system32\\attrib.exe /badargument" }
let(:processor_architecture_script_content) { "echo $env:PROCESSOR_ARCHITECTURE" }
let(:native_architecture_script_content) { "echo $env:PROCESSOR_ARCHITECTUREW6432" }
let(:cmdlet_exit_code_not_found_content) { "get-item '.\\thisdoesnotexist'" }
let(:cmdlet_exit_code_success_content) { "get-item ." }
- let(:windows_process_exit_code_success_content) { "#{ENV['SystemRoot']}\\system32\\attrib.exe $env:systemroot" }
+ let(:windows_process_exit_code_success_content) { "#{ENV["SystemRoot"]}\\system32\\attrib.exe $env:systemroot" }
let(:windows_process_exit_code_not_found_content) { "findstr /notavalidswitch" }
let(:arbitrary_nonzero_process_exit_code) { 4193 }
let(:arbitrary_nonzero_process_exit_code_content) { "exit #{arbitrary_nonzero_process_exit_code}" }
@@ -479,26 +479,26 @@ describe Chef::Resource::WindowsScript::PowershellScript, :windows_only do
end
it "evaluates a not_if block using the cwd guard parameter" do
- custom_cwd = "#{ENV['SystemRoot']}\\system32\\drivers\\etc"
+ custom_cwd = "#{ENV["SystemRoot"]}\\system32\\drivers\\etc"
resource.not_if "exit ! [int32]($pwd.path -eq '#{custom_cwd}')", cwd: custom_cwd
expect(resource.should_skip?(:run)).to be_truthy
end
it "evaluates an only_if block using the cwd guard parameter" do
- custom_cwd = "#{ENV['SystemRoot']}\\system32\\drivers\\etc"
+ custom_cwd = "#{ENV["SystemRoot"]}\\system32\\drivers\\etc"
resource.only_if "exit ! [int32]($pwd.path -eq '#{custom_cwd}')", cwd: custom_cwd
expect(resource.should_skip?(:run)).to be_falsey
end
it "inherits cwd from the parent resource for only_if" do
- custom_cwd = "#{ENV['SystemRoot']}\\system32\\drivers\\etc"
+ custom_cwd = "#{ENV["SystemRoot"]}\\system32\\drivers\\etc"
resource.cwd custom_cwd
resource.only_if "exit ! [int32]($pwd.path -eq '#{custom_cwd}')"
expect(resource.should_skip?(:run)).to be_falsey
end
it "inherits cwd from the parent resource for not_if" do
- custom_cwd = "#{ENV['SystemRoot']}\\system32\\drivers\\etc"
+ custom_cwd = "#{ENV["SystemRoot"]}\\system32\\drivers\\etc"
resource.cwd custom_cwd
resource.not_if "exit ! [int32]($pwd.path -eq '#{custom_cwd}')"
expect(resource.should_skip?(:run)).to be_truthy
diff --git a/spec/functional/resource/remote_file_spec.rb b/spec/functional/resource/remote_file_spec.rb
index b7e482794c..ffa0364d1d 100644
--- a/spec/functional/resource/remote_file_spec.rb
+++ b/spec/functional/resource/remote_file_spec.rb
@@ -134,7 +134,7 @@ describe Chef::Resource::RemoteFile do
let(:smb_file_local_file_name) { "smb_file.txt" }
let(:smb_file_local_path) { File.join( smb_share_root_directory, smb_file_local_file_name ) }
let(:smb_share_name) { "chef_smb_test" }
- let(:smb_remote_path) { File.join("//#{ENV['COMPUTERNAME']}", smb_share_name, smb_file_local_file_name).gsub(%r{/}, "\\") }
+ let(:smb_remote_path) { File.join("//#{ENV["COMPUTERNAME"]}", smb_share_name, smb_file_local_file_name).gsub(%r{/}, "\\") }
let(:smb_file_content) { "hellofun" }
let(:local_destination_path) { File.join(Dir.tmpdir, make_tmpname("chef_remote_file")) }
let(:windows_current_user) { ENV["USERNAME"] }
diff --git a/spec/functional/resource/user/windows_spec.rb b/spec/functional/resource/user/windows_spec.rb
index 3a5535f194..6bab270f56 100644
--- a/spec/functional/resource/user/windows_spec.rb
+++ b/spec/functional/resource/user/windows_spec.rb
@@ -47,13 +47,13 @@ describe Chef::Provider::User::Windows, :windows_only do
end
def backup_secedit_policy
- backup_command = "secedit /export /cfg #{ENV['TEMP']}\\secedit_restore.inf /areas SECURITYPOLICY"
+ backup_command = "secedit /export /cfg #{ENV["TEMP"]}\\secedit_restore.inf /areas SECURITYPOLICY"
shell_out(backup_command)
end
def restore_secedit_policy
security_database = "C:\\windows\\security\\database\\seceditnew.sdb"
- restore_command = "secedit /configure /db #{security_database} /cfg #{ENV['TEMP']}\\secedit_restore.inf /areas SECURITYPOLICY"
+ restore_command = "secedit /configure /db #{security_database} /cfg #{ENV["TEMP"]}\\secedit_restore.inf /areas SECURITYPOLICY"
shell_out(restore_command)
end
diff --git a/spec/functional/resource/windows_service_spec.rb b/spec/functional/resource/windows_service_spec.rb
index 3e46e8c2d0..999b235df1 100644
--- a/spec/functional/resource/windows_service_spec.rb
+++ b/spec/functional/resource/windows_service_spec.rb
@@ -24,7 +24,7 @@ describe Chef::Resource::WindowsService, :windows_only, :system_windows_service_
include_context "using Win32::Service"
let(:username) { "service_spec_user" }
- let(:qualified_username) { "#{ENV['COMPUTERNAME']}\\#{username}" }
+ let(:qualified_username) { "#{ENV["COMPUTERNAME"]}\\#{username}" }
let(:password) { "1a2b3c4X!&narf" }
let(:user_resource) do
@@ -36,7 +36,7 @@ describe Chef::Resource::WindowsService, :windows_only, :system_windows_service_
end
let(:global_service_file_path) do
- "#{ENV['WINDIR']}\\temp\\#{File.basename(test_service[:service_file_path])}"
+ "#{ENV["WINDIR"]}\\temp\\#{File.basename(test_service[:service_file_path])}"
end
let(:service_params) do
diff --git a/spec/functional/util/powershell/cmdlet_spec.rb b/spec/functional/util/powershell/cmdlet_spec.rb
index 4be021a60b..8ec4fa1366 100644
--- a/spec/functional/util/powershell/cmdlet_spec.rb
+++ b/spec/functional/util/powershell/cmdlet_spec.rb
@@ -29,7 +29,7 @@ describe Chef::Util::Powershell::Cmdlet, :windows_powershell_dsc_only do
let(:invalid_cmdlet) { Chef::Util::Powershell::Cmdlet.new(@node, "get-idontexist", cmd_output_format) }
let(:cmdlet_get_item_requires_switch_or_argument) { Chef::Util::Powershell::Cmdlet.new(@node, "get-item", cmd_output_format, { depth: 2 }) }
let(:cmdlet_alias_requires_switch_or_argument) { Chef::Util::Powershell::Cmdlet.new(@node, "alias", cmd_output_format, { depth: 2 }) }
- let(:etc_directory) { "#{ENV['systemroot']}\\system32\\drivers\\etc" }
+ let(:etc_directory) { "#{ENV["systemroot"]}\\system32\\drivers\\etc" }
let(:architecture_cmdlet) { Chef::Util::Powershell::Cmdlet.new(@node, "$env:PROCESSOR_ARCHITECTURE") }
it "executes a simple process" do