summaryrefslogtreecommitdiff
path: root/spec
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
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')
-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
-rw-r--r--spec/integration/client/client_spec.rb156
-rw-r--r--spec/integration/client/exit_code_spec.rb4
-rw-r--r--spec/integration/client/ipv6_spec.rb4
-rw-r--r--spec/integration/knife/chef_fs_data_store_spec.rb50
-rw-r--r--spec/integration/knife/chef_repo_path_spec.rb8
-rw-r--r--spec/integration/knife/cookbook_api_ipv6_spec.rb2
-rw-r--r--spec/integration/knife/diff_spec.rb4
-rw-r--r--spec/integration/knife/download_spec.rb2
-rw-r--r--spec/integration/knife/redirection_spec.rb2
-rw-r--r--spec/integration/knife/upload_spec.rb4
-rw-r--r--spec/integration/recipes/accumulator_spec.rb8
-rw-r--r--spec/integration/recipes/lwrp_inline_resources_spec.rb4
-rw-r--r--spec/integration/recipes/lwrp_spec.rb4
-rw-r--r--spec/integration/recipes/notifies_spec.rb40
-rw-r--r--spec/integration/recipes/notifying_block_spec.rb8
-rw-r--r--spec/integration/recipes/remote_directory.rb4
-rw-r--r--spec/integration/solo/solo_spec.rb40
-rw-r--r--spec/support/platforms/win32/spec_service.rb2
-rw-r--r--spec/support/shared/functional/execute_resource.rb6
-rw-r--r--spec/support/shared/functional/securable_resource.rb2
-rw-r--r--spec/support/shared/functional/win32_service.rb2
-rw-r--r--spec/support/shared/integration/knife_support.rb2
-rw-r--r--spec/tiny_server.rb2
-rw-r--r--spec/unit/deprecated_spec.rb2
-rw-r--r--spec/unit/node_spec.rb6
-rw-r--r--spec/unit/provider/package/cab_spec.rb2
-rw-r--r--spec/unit/provider/package/msu_spec.rb2
-rw-r--r--spec/unit/resource/chef_gem_spec.rb2
-rw-r--r--spec/unit/version_class_spec.rb2
41 files changed, 211 insertions, 211 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
diff --git a/spec/integration/client/client_spec.rb b/spec/integration/client/client_spec.rb
index c2dc740025..7ae255eabf 100644
--- a/spec/integration/client/client_spec.rb
+++ b/spec/integration/client/client_spec.rb
@@ -55,19 +55,19 @@ describe "chef-client" do
it "should complete with success" do
file "config/client.rb", <<~EOM
local_mode true
- cookbook_path "#{path_to('cookbooks')}"
+ cookbook_path "#{path_to("cookbooks")}"
EOM
- shell_out!("#{chef_client} -c \"#{path_to('config/client.rb')}\" -o 'x::default'", cwd: chef_dir)
+ shell_out!("#{chef_client} -c \"#{path_to("config/client.rb")}\" -o 'x::default'", cwd: chef_dir)
end
it "should complete successfully with --no-listen" do
file "config/client.rb", <<~EOM
local_mode true
- cookbook_path "#{path_to('cookbooks')}"
+ cookbook_path "#{path_to("cookbooks")}"
EOM
- result = shell_out("#{chef_client} --no-listen -c \"#{path_to('config/client.rb')}\" -o 'x::default'", cwd: chef_dir)
+ result = shell_out("#{chef_client} --no-listen -c \"#{path_to("config/client.rb")}\" -o 'x::default'", cwd: chef_dir)
result.error!
end
@@ -108,10 +108,10 @@ describe "chef-client" do
it "should complete with success" do
file "config/client.rb", <<~EOM
local_mode true
- cookbook_path "#{path_to('cookbooks')}"
+ cookbook_path "#{path_to("cookbooks")}"
EOM
- result = shell_out("#{chef_client} -c \"#{path_to('config/client.rb')}\" -o 'x::default'", cwd: chef_dir)
+ result = shell_out("#{chef_client} -c \"#{path_to("config/client.rb")}\" -o 'x::default'", cwd: chef_dir)
result.error!
end
@@ -151,34 +151,34 @@ describe "chef-client" do
it "should complete with success even with a client key" do
file "config/client.rb", <<~EOM
local_mode true
- client_key #{path_to('mykey.pem').inspect}
- cookbook_path #{path_to('cookbooks').inspect}
+ client_key #{path_to("mykey.pem").inspect}
+ cookbook_path #{path_to("cookbooks").inspect}
EOM
- result = shell_out("#{chef_client} -c \"#{path_to('config/client.rb')}\" -o 'x::default'", cwd: chef_dir)
+ result = shell_out("#{chef_client} -c \"#{path_to("config/client.rb")}\" -o 'x::default'", cwd: chef_dir)
result.error!
end
it "should run recipes specified directly on the command line" do
file "config/client.rb", <<~EOM
local_mode true
- client_key #{path_to('mykey.pem').inspect}
- cookbook_path #{path_to('cookbooks').inspect}
+ client_key #{path_to("mykey.pem").inspect}
+ cookbook_path #{path_to("cookbooks").inspect}
EOM
file "arbitrary.rb", <<~EOM
- file #{path_to('tempfile.txt').inspect} do
+ file #{path_to("tempfile.txt").inspect} do
content '1'
end
EOM
file "arbitrary2.rb", <<~EOM
- file #{path_to('tempfile2.txt').inspect} do
+ file #{path_to("tempfile2.txt").inspect} do
content '2'
end
EOM
- result = shell_out("#{chef_client} -c \"#{path_to('config/client.rb')}\" #{path_to('arbitrary.rb')} #{path_to('arbitrary2.rb')}", cwd: chef_dir)
+ result = shell_out("#{chef_client} -c \"#{path_to("config/client.rb")}\" #{path_to("arbitrary.rb")} #{path_to("arbitrary2.rb")}", cwd: chef_dir)
result.error!
expect(IO.read(path_to("tempfile.txt"))).to eq("1")
@@ -188,17 +188,17 @@ describe "chef-client" do
it "should run recipes specified as relative paths directly on the command line" do
file "config/client.rb", <<~EOM
local_mode true
- client_key #{path_to('mykey.pem').inspect}
- cookbook_path #{path_to('cookbooks').inspect}
+ client_key #{path_to("mykey.pem").inspect}
+ cookbook_path #{path_to("cookbooks").inspect}
EOM
file "arbitrary.rb", <<~EOM
- file #{path_to('tempfile.txt').inspect} do
+ file #{path_to("tempfile.txt").inspect} do
content '1'
end
EOM
- result = shell_out("#{chef_client} -c \"#{path_to('config/client.rb')}\" arbitrary.rb", cwd: path_to(""))
+ result = shell_out("#{chef_client} -c \"#{path_to("config/client.rb")}\" arbitrary.rb", cwd: path_to(""))
result.error!
expect(IO.read(path_to("tempfile.txt"))).to eq("1")
@@ -207,8 +207,8 @@ describe "chef-client" do
it "should run recipes specified directly on the command line AFTER recipes in the run list" do
file "config/client.rb", <<~EOM
local_mode true
- client_key #{path_to('mykey.pem').inspect}
- cookbook_path #{path_to('cookbooks').inspect}
+ client_key #{path_to("mykey.pem").inspect}
+ cookbook_path #{path_to("cookbooks").inspect}
EOM
file "cookbooks/x/recipes/constant_definition.rb", <<~EOM
@@ -218,12 +218,12 @@ describe "chef-client" do
EOM
file "arbitrary.rb", <<~EOM
- file #{path_to('tempfile.txt').inspect} do
+ file #{path_to("tempfile.txt").inspect} do
content ::Blah::THECONSTANT
end
EOM
- result = shell_out("#{chef_client} -c \"#{path_to('config/client.rb')}\" -o x::constant_definition arbitrary.rb", cwd: path_to(""))
+ result = shell_out("#{chef_client} -c \"#{path_to("config/client.rb")}\" -o x::constant_definition arbitrary.rb", cwd: path_to(""))
result.error!
expect(IO.read(path_to("tempfile.txt"))).to eq("1")
@@ -232,8 +232,8 @@ describe "chef-client" do
it "should run recipes specified directly on the command line AFTER recipes in the run list (without an override_runlist this time)" do
file "config/client.rb", <<~EOM
local_mode true
- client_key #{path_to('mykey.pem').inspect}
- cookbook_path #{path_to('cookbooks').inspect}
+ client_key #{path_to("mykey.pem").inspect}
+ cookbook_path #{path_to("cookbooks").inspect}
EOM
file "config/dna.json", <<~EOM
@@ -249,12 +249,12 @@ describe "chef-client" do
EOM
file "arbitrary.rb", <<~EOM
- file #{path_to('tempfile.txt').inspect} do
+ file #{path_to("tempfile.txt").inspect} do
content ::Blah::THECONSTANT
end
EOM
- result = shell_out("#{chef_client} -c \"#{path_to('config/client.rb')}\" -j \"#{path_to('config/dna.json')}\" arbitrary.rb", cwd: path_to(""))
+ result = shell_out("#{chef_client} -c \"#{path_to("config/client.rb")}\" -j \"#{path_to("config/dna.json")}\" arbitrary.rb", cwd: path_to(""))
result.error!
expect(IO.read(path_to("tempfile.txt"))).to eq("1")
@@ -263,8 +263,8 @@ describe "chef-client" do
it "an override_runlist of an empty string should allow a recipe specified directly on the command line to be the only one run" do
file "config/client.rb", <<~EOM
local_mode true
- client_key #{path_to('mykey.pem').inspect}
- cookbook_path #{path_to('cookbooks').inspect}
+ client_key #{path_to("mykey.pem").inspect}
+ cookbook_path #{path_to("cookbooks").inspect}
class ::Blah
THECONSTANT = "1"
end
@@ -284,12 +284,12 @@ describe "chef-client" do
file "arbitrary.rb", <<~EOM
raise "this test failed" unless ::Blah::THECONSTANT == "1"
- file #{path_to('tempfile.txt').inspect} do
+ file #{path_to("tempfile.txt").inspect} do
content ::Blah::THECONSTANT
end
EOM
- result = shell_out("#{chef_client} -c \"#{path_to('config/client.rb')}\" -j \"#{path_to('config/dna.json')}\" -o \"\" arbitrary.rb", cwd: path_to(""))
+ result = shell_out("#{chef_client} -c \"#{path_to("config/client.rb")}\" -j \"#{path_to("config/dna.json")}\" -o \"\" arbitrary.rb", cwd: path_to(""))
result.error!
expect(IO.read(path_to("tempfile.txt"))).to eq("1")
@@ -300,30 +300,30 @@ describe "chef-client" do
it "should complete with success when passed the -z flag" do
file "config/client.rb", <<~EOM
chef_server_url 'http://omg.com/blah'
- cookbook_path "#{path_to('cookbooks')}"
+ cookbook_path "#{path_to("cookbooks")}"
EOM
- result = shell_out("#{chef_client} -c \"#{path_to('config/client.rb')}\" -o 'x::default' -z", cwd: chef_dir)
+ result = shell_out("#{chef_client} -c \"#{path_to("config/client.rb")}\" -o 'x::default' -z", cwd: chef_dir)
result.error!
end
it "should complete with success when passed the --local-mode flag" do
file "config/client.rb", <<~EOM
chef_server_url 'http://omg.com/blah'
- cookbook_path "#{path_to('cookbooks')}"
+ cookbook_path "#{path_to("cookbooks")}"
EOM
- result = shell_out("#{chef_client} -c \"#{path_to('config/client.rb')}\" -o 'x::default' --local-mode", cwd: chef_dir)
+ result = shell_out("#{chef_client} -c \"#{path_to("config/client.rb")}\" -o 'x::default' --local-mode", cwd: chef_dir)
result.error!
end
it "should not print SSL warnings when running in local-mode" do
file "config/client.rb", <<~EOM
chef_server_url 'http://omg.com/blah'
- cookbook_path "#{path_to('cookbooks')}"
+ cookbook_path "#{path_to("cookbooks")}"
EOM
- result = shell_out("#{chef_client} -c \"#{path_to('config/client.rb')}\" -o 'x::default' --local-mode", cwd: chef_dir)
+ result = shell_out("#{chef_client} -c \"#{path_to("config/client.rb")}\" -o 'x::default' --local-mode", cwd: chef_dir)
expect(result.stdout).not_to include("SSL validation of HTTPS requests is disabled.")
result.error!
end
@@ -331,20 +331,20 @@ describe "chef-client" do
it "should complete with success when passed -z and --chef-zero-port" do
file "config/client.rb", <<~EOM
chef_server_url 'http://omg.com/blah'
- cookbook_path "#{path_to('cookbooks')}"
+ cookbook_path "#{path_to("cookbooks")}"
EOM
- result = shell_out("#{chef_client} -c \"#{path_to('config/client.rb')}\" -o 'x::default' -z", cwd: chef_dir)
+ result = shell_out("#{chef_client} -c \"#{path_to("config/client.rb")}\" -o 'x::default' -z", cwd: chef_dir)
result.error!
end
it "should complete with success when setting the run list with -r" do
file "config/client.rb", <<~EOM
chef_server_url 'http://omg.com/blah'
- cookbook_path "#{path_to('cookbooks')}"
+ cookbook_path "#{path_to("cookbooks")}"
EOM
- result = shell_out("#{chef_client} -c \"#{path_to('config/client.rb')}\" -r 'x::default' -z -l info", cwd: chef_dir)
+ result = shell_out("#{chef_client} -c \"#{path_to("config/client.rb")}\" -r 'x::default' -z -l info", cwd: chef_dir)
expect(result.stdout).not_to include("Overridden Run List")
expect(result.stdout).to include("Run List is [recipe[x::default]]")
result.error!
@@ -353,9 +353,9 @@ describe "chef-client" do
it "should complete with success when using --profile-ruby and output a profile file", :not_supported_on_aix do
file "config/client.rb", <<~EOM
local_mode true
- cookbook_path "#{path_to('cookbooks')}"
+ cookbook_path "#{path_to("cookbooks")}"
EOM
- result = shell_out!("#{chef_client} -c \"#{path_to('config/client.rb')}\" -o 'x::default' -z --profile-ruby", cwd: chef_dir)
+ result = shell_out!("#{chef_client} -c \"#{path_to("config/client.rb")}\" -o 'x::default' -z --profile-ruby", cwd: chef_dir)
result.error!
expect(File.exist?(path_to("config/local-mode-cache/cache/graph_profile.out"))).to be true
end
@@ -363,9 +363,9 @@ describe "chef-client" do
it "doesn't produce a profile when --profile-ruby is not present" do
file "config/client.rb", <<~EOM
local_mode true
- cookbook_path "#{path_to('cookbooks')}"
+ cookbook_path "#{path_to("cookbooks")}"
EOM
- result = shell_out!("#{chef_client} -c \"#{path_to('config/client.rb')}\" -o 'x::default' -z", cwd: chef_dir)
+ result = shell_out!("#{chef_client} -c \"#{path_to("config/client.rb")}\" -o 'x::default' -z", cwd: chef_dir)
result.error!
expect(File.exist?(path_to("config/local-mode-cache/cache/graph_profile.out"))).to be false
end
@@ -381,11 +381,11 @@ describe "chef-client" do
EOM
file "config/client.rb", <<~EOM
local_mode true
- cookbook_path "#{path_to('cookbooks')}"
+ cookbook_path "#{path_to("cookbooks")}"
EOM
end
it "should fail the chef client run" do
- command = shell_out("#{chef_client} -c \"#{path_to('config/client.rb')}\" -o 'x::default' --no-fork", cwd: chef_dir)
+ command = shell_out("#{chef_client} -c \"#{path_to("config/client.rb")}\" -o 'x::default' --no-fork", cwd: chef_dir)
expect(command.exitstatus).to eql(1)
expect(command.stdout).to match(/Chef::Exceptions::CookbookChefVersionMismatch/)
end
@@ -406,12 +406,12 @@ describe "chef-client" do
EOM
file "config/client.rb", <<-EOM
local_mode true
- cookbook_path "#{path_to('cookbooks')}"
+ cookbook_path "#{path_to("cookbooks")}"
EOM
end
it "the cheffish DSL is loaded lazily" do
- command = shell_out("#{chef_client} -c \"#{path_to('config/client.rb')}\" -o 'x::default' --no-fork", cwd: chef_dir)
+ command = shell_out("#{chef_client} -c \"#{path_to("config/client.rb")}\" -o 'x::default' --no-fork", cwd: chef_dir)
expect(command.exitstatus).to eql(0)
end
end
@@ -437,7 +437,7 @@ describe "chef-client" do
it "should output each deprecation warning only once, at the end of the run" do
file "config/client.rb", <<~EOM
local_mode true
- cookbook_path "#{path_to('cookbooks')}"
+ cookbook_path "#{path_to("cookbooks")}"
# Mimick what happens when you are on the console
formatters << :doc
log_level :warn
@@ -445,7 +445,7 @@ describe "chef-client" do
ENV.delete("CHEF_TREAT_DEPRECATION_WARNINGS_AS_ERRORS")
- result = shell_out!("#{chef_client} -c \"#{path_to('config/client.rb')}\" -o 'x::default'", cwd: chef_dir)
+ result = shell_out!("#{chef_client} -c \"#{path_to("config/client.rb")}\" -o 'x::default'", cwd: chef_dir)
expect(result.error?).to be_falsey
# Search to the end of the client run in the output
@@ -460,7 +460,7 @@ describe "chef-client" do
when_the_repository "has a cookbook that deploys a file" do
before do
file "cookbooks/x/recipes/default.rb", <<~RECIPE
- cookbook_file #{path_to('tempfile.txt').inspect} do
+ cookbook_file #{path_to("tempfile.txt").inspect} do
source "my_file"
end
RECIPE
@@ -476,9 +476,9 @@ describe "chef-client" do
file "config/client.rb", <<~EOM
no_lazy_load #{lazy}
local_mode true
- cookbook_path "#{path_to('cookbooks')}"
+ cookbook_path "#{path_to("cookbooks")}"
EOM
- result = shell_out("#{chef_client} -l debug -c \"#{path_to('config/client.rb')}\" -o 'x::default' --no-fork", cwd: chef_dir)
+ result = shell_out("#{chef_client} -l debug -c \"#{path_to("config/client.rb")}\" -o 'x::default' --no-fork", cwd: chef_dir)
result.error!
expect(IO.read(path_to("tempfile.txt")).strip).to eq("this is my file")
@@ -490,7 +490,7 @@ describe "chef-client" do
when_the_repository "has a cookbook with an ohai plugin" do
before do
file "cookbooks/x/recipes/default.rb", <<~RECIPE
- file #{path_to('tempfile.txt').inspect} do
+ file #{path_to("tempfile.txt").inspect} do
content node["english"]["version"]
end
RECIPE
@@ -508,12 +508,12 @@ describe "chef-client" do
file "config/client.rb", <<~EOM
local_mode true
- cookbook_path "#{path_to('cookbooks')}"
+ cookbook_path "#{path_to("cookbooks")}"
EOM
end
it "should run the ohai plugin" do
- result = shell_out("#{chef_client} -l debug -c \"#{path_to('config/client.rb')}\" -o 'x::default' --no-fork", cwd: chef_dir)
+ result = shell_out("#{chef_client} -l debug -c \"#{path_to("config/client.rb")}\" -o 'x::default' --no-fork", cwd: chef_dir)
result.error!
expect(IO.read(path_to("tempfile.txt"))).to eq("2014")
@@ -536,7 +536,7 @@ describe "chef-client" do
file "config/client.rb", <<~EOM
chef_repo_path "#{tmp_dir}"
EOM
- result = shell_out("#{chef_client} -c \"#{path_to('config/client.rb')}\" --recipe-url=http://localhost:9000/recipes.tgz -o 'x::default' -z", cwd: tmp_dir)
+ result = shell_out("#{chef_client} -c \"#{path_to("config/client.rb")}\" --recipe-url=http://localhost:9000/recipes.tgz -o 'x::default' -z", cwd: tmp_dir)
result.error!
end
@@ -569,17 +569,17 @@ describe "chef-client" do
file "config/client.rb", <<~EOM
local_mode true
- cookbook_path "#{path_to('cookbooks')}"
+ cookbook_path "#{path_to("cookbooks")}"
EOM
end
it "the chef client run should succeed" do
- command = shell_out("#{chef_client} -c \"#{path_to('config/client.rb')}\" -o 'x::default' --no-fork", cwd: chef_dir)
+ command = shell_out("#{chef_client} -c \"#{path_to("config/client.rb")}\" -o 'x::default' --no-fork", cwd: chef_dir)
command.error!
end
it "a chef-solo run should succeed" do
- command = shell_out("#{chef_solo} -c \"#{path_to('config/client.rb')}\" -o 'x::default' --no-fork", cwd: chef_dir)
+ command = shell_out("#{chef_solo} -c \"#{path_to("config/client.rb")}\" -o 'x::default' --no-fork", cwd: chef_dir)
command.error!
end
end
@@ -593,30 +593,30 @@ describe "chef-client" do
EOM
file "config/client.rb", <<~EOM
local_mode true
- cookbook_path "#{path_to('cookbooks')}"
+ cookbook_path "#{path_to("cookbooks")}"
EOM
end
it "a chef client run should not log to info by default" do
- command = shell_out("#{chef_client} -c \"#{path_to('config/client.rb')}\" -o 'x::default' --no-fork", cwd: chef_dir)
+ command = shell_out("#{chef_client} -c \"#{path_to("config/client.rb")}\" -o 'x::default' --no-fork", cwd: chef_dir)
command.error!
expect(command.stdout).not_to include("INFO")
end
it "a chef client run to a pipe should not log to info by default" do
- command = shell_out("#{chef_client} -c \"#{path_to('config/client.rb')}\" -o 'x::default' --no-fork | tee #{path_to('chefrun.out')}", cwd: chef_dir)
+ command = shell_out("#{chef_client} -c \"#{path_to("config/client.rb")}\" -o 'x::default' --no-fork | tee #{path_to("chefrun.out")}", cwd: chef_dir)
command.error!
expect(command.stdout).not_to include("INFO")
end
it "a chef solo run should not log to info by default" do
- command = shell_out("#{chef_solo} -c \"#{path_to('config/client.rb')}\" -o 'x::default' --no-fork", cwd: chef_dir)
+ command = shell_out("#{chef_solo} -c \"#{path_to("config/client.rb")}\" -o 'x::default' --no-fork", cwd: chef_dir)
command.error!
expect(command.stdout).not_to include("INFO")
end
it "a chef solo run to a pipe should not log to info by default" do
- command = shell_out("#{chef_solo} -c \"#{path_to('config/client.rb')}\" -o 'x::default' --no-fork | tee #{path_to('chefrun.out')}", cwd: chef_dir)
+ command = shell_out("#{chef_solo} -c \"#{path_to("config/client.rb")}\" -o 'x::default' --no-fork | tee #{path_to("chefrun.out")}", cwd: chef_dir)
command.error!
expect(command.stdout).not_to include("INFO")
end
@@ -629,42 +629,42 @@ EOM
EOM
file "config/client.rb", <<~EOM
local_mode true
- cookbook_path "#{path_to('cookbooks')}"
+ cookbook_path "#{path_to("cookbooks")}"
EOM
end
it "chef-client runs by default with no supervisor" do
- command = shell_out("#{chef_client} -c \"#{path_to('config/client.rb')}\" -o 'x::default'", cwd: chef_dir)
+ command = shell_out("#{chef_client} -c \"#{path_to("config/client.rb")}\" -o 'x::default'", cwd: chef_dir)
command.error!
expect(command.stdout).to include("NOFORK")
end
it "chef-solo runs by default with no supervisor" do
- command = shell_out("#{chef_solo} -c \"#{path_to('config/client.rb')}\" -o 'x::default'", cwd: chef_dir)
+ command = shell_out("#{chef_solo} -c \"#{path_to("config/client.rb")}\" -o 'x::default'", cwd: chef_dir)
command.error!
expect(command.stdout).to include("NOFORK")
end
it "chef-client --no-fork does not fork" do
- command = shell_out("#{chef_client} -c \"#{path_to('config/client.rb')}\" -o 'x::default' --no-fork", cwd: chef_dir)
+ command = shell_out("#{chef_client} -c \"#{path_to("config/client.rb")}\" -o 'x::default' --no-fork", cwd: chef_dir)
command.error!
expect(command.stdout).to include("NOFORK")
end
it "chef-solo --no-fork does not fork" do
- command = shell_out("#{chef_solo} -c \"#{path_to('config/client.rb')}\" -o 'x::default' --no-fork", cwd: chef_dir)
+ command = shell_out("#{chef_solo} -c \"#{path_to("config/client.rb")}\" -o 'x::default' --no-fork", cwd: chef_dir)
command.error!
expect(command.stdout).to include("NOFORK")
end
it "chef-client with --fork uses a supervisor" do
- command = shell_out("#{chef_client} -c \"#{path_to('config/client.rb')}\" -o 'x::default' --fork", cwd: chef_dir)
+ command = shell_out("#{chef_client} -c \"#{path_to("config/client.rb")}\" -o 'x::default' --fork", cwd: chef_dir)
command.error!
expect(command.stdout).to include("WITHFORK")
end
it "chef-solo with --fork uses a supervisor" do
- command = shell_out("#{chef_solo} -c \"#{path_to('config/client.rb')}\" -o 'x::default' --fork", cwd: chef_dir)
+ command = shell_out("#{chef_solo} -c \"#{path_to("config/client.rb")}\" -o 'x::default' --fork", cwd: chef_dir)
command.error!
expect(command.stdout).to include("WITHFORK")
end
@@ -677,19 +677,19 @@ EOM
EOM
file "config/client.rb", <<~EOM
local_mode true
- cookbook_path "#{path_to('cookbooks')}"
+ cookbook_path "#{path_to("cookbooks")}"
client_fork true
EOM
end
it "chef-client uses a supervisor" do
- command = shell_out("#{chef_client} -c \"#{path_to('config/client.rb')}\" -o 'x::default'", cwd: chef_dir)
+ command = shell_out("#{chef_client} -c \"#{path_to("config/client.rb")}\" -o 'x::default'", cwd: chef_dir)
command.error!
expect(command.stdout).to include("WITHFORK")
end
it "chef-solo uses a supervisor" do
- command = shell_out("#{chef_solo} -c \"#{path_to('config/client.rb')}\" -o 'x::default'", cwd: chef_dir)
+ command = shell_out("#{chef_solo} -c \"#{path_to("config/client.rb")}\" -o 'x::default'", cwd: chef_dir)
command.error!
expect(command.stdout).to include("WITHFORK")
end
@@ -702,19 +702,19 @@ EOM
EOM
file "config/client.rb", <<~EOM
local_mode true
- cookbook_path "#{path_to('cookbooks')}"
+ cookbook_path "#{path_to("cookbooks")}"
client_fork false
EOM
end
it "chef-client uses a supervisor" do
- command = shell_out("#{chef_client} -c \"#{path_to('config/client.rb')}\" -o 'x::default'", cwd: chef_dir)
+ command = shell_out("#{chef_client} -c \"#{path_to("config/client.rb")}\" -o 'x::default'", cwd: chef_dir)
command.error!
expect(command.stdout).to include("NOFORK")
end
it "chef-solo uses a supervisor" do
- command = shell_out("#{chef_solo} -c \"#{path_to('config/client.rb')}\" -o 'x::default'", cwd: chef_dir)
+ command = shell_out("#{chef_solo} -c \"#{path_to("config/client.rb")}\" -o 'x::default'", cwd: chef_dir)
command.error!
expect(command.stdout).to include("NOFORK")
end
diff --git a/spec/integration/client/exit_code_spec.rb b/spec/integration/client/exit_code_spec.rb
index ff48d69527..37999ab431 100644
--- a/spec/integration/client/exit_code_spec.rb
+++ b/spec/integration/client/exit_code_spec.rb
@@ -30,12 +30,12 @@ describe "chef-client" do
def setup_client_rb
file "config/client.rb", <<~EOM
local_mode true
- cookbook_path "#{path_to('cookbooks')}"
+ cookbook_path "#{path_to("cookbooks")}"
EOM
end
def run_chef_client_and_expect_exit_code(exit_code)
- shell_out!("#{chef_client} -c \"#{path_to('config/client.rb')}\" -o 'x::default'",
+ shell_out!("#{chef_client} -c \"#{path_to("config/client.rb")}\" -o 'x::default'",
cwd: chef_dir,
returns: [exit_code])
end
diff --git a/spec/integration/client/ipv6_spec.rb b/spec/integration/client/ipv6_spec.rb
index b97eb4e8b4..2d16786334 100644
--- a/spec/integration/client/ipv6_spec.rb
+++ b/spec/integration/client/ipv6_spec.rb
@@ -63,7 +63,7 @@ describe "chef-client" do
let(:basic_config_file) do
<<~END_CLIENT_RB
chef_server_url "http://[::1]:8900"
- validation_key '#{path_to('config/validator.pem')}'
+ validation_key '#{path_to("config/validator.pem")}'
cache_path '#{cache_path}'
client_key '#{cache_path}/client.pem'
END_CLIENT_RB
@@ -75,7 +75,7 @@ describe "chef-client" do
let(:chef_dir) { File.join(File.dirname(__FILE__), "..", "..", "..", "bin") }
- let(:chef_client_cmd) { %Q{bundle exec chef-client --minimal-ohai -c "#{path_to('config/client.rb')}" -lwarn} }
+ let(:chef_client_cmd) { %Q{bundle exec chef-client --minimal-ohai -c "#{path_to("config/client.rb")}" -lwarn} }
after do
FileUtils.rm_rf(cache_path)
diff --git a/spec/integration/knife/chef_fs_data_store_spec.rb b/spec/integration/knife/chef_fs_data_store_spec.rb
index abd4f129a1..58ca5121c5 100644
--- a/spec/integration/knife/chef_fs_data_store_spec.rb
+++ b/spec/integration/knife/chef_fs_data_store_spec.rb
@@ -185,12 +185,12 @@ describe "ChefFSDataStore tests", :workstation do
end
it "knife raw -z -i empty.json -m PUT /clients/x" do
- knife("raw -z -i #{path_to('empty.json')} -m PUT /clients/x").should_succeed( /"x"/ )
+ knife("raw -z -i #{path_to("empty.json")} -m PUT /clients/x").should_succeed( /"x"/ )
knife("list --local /clients").should_succeed "/clients/x.json\n"
end
it "knife cookbook upload works" do
- knife("cookbook upload -z --cookbook-path #{path_to('cookbooks_to_upload')} x").should_succeed stderr: <<~EOM
+ knife("cookbook upload -z --cookbook-path #{path_to("cookbooks_to_upload")} x").should_succeed stderr: <<~EOM
Uploading x [1.0.0]
Uploaded 1 cookbook.
EOM
@@ -198,28 +198,28 @@ describe "ChefFSDataStore tests", :workstation do
end
it "knife raw -z -i empty.json -m PUT /data/x/y" do
- knife("raw -z -i #{path_to('empty.json')} -m PUT /data/x/y").should_succeed( /"y"/ )
+ knife("raw -z -i #{path_to("empty.json")} -m PUT /data/x/y").should_succeed( /"y"/ )
knife("list --local -Rfp /data_bags").should_succeed "/data_bags/x/\n/data_bags/x/y.json\n"
end
it "knife raw -z -i empty.json -m PUT /environments/x" do
- knife("raw -z -i #{path_to('empty.json')} -m PUT /environments/x").should_succeed( /"x"/ )
+ knife("raw -z -i #{path_to("empty.json")} -m PUT /environments/x").should_succeed( /"x"/ )
knife("list --local /environments").should_succeed "/environments/x.json\n"
end
it "knife raw -z -i dummynode.json -m PUT /nodes/x" do
- knife("raw -z -i #{path_to('dummynode.json')} -m PUT /nodes/x").should_succeed( /"x"/ )
+ knife("raw -z -i #{path_to("dummynode.json")} -m PUT /nodes/x").should_succeed( /"x"/ )
knife("list --local /nodes").should_succeed "/nodes/x.json\n"
knife("show -z /nodes/x.json --verbose").should_succeed(/"bar"/)
end
it "knife raw -z -i empty.json -m PUT /roles/x" do
- knife("raw -z -i #{path_to('empty.json')} -m PUT /roles/x").should_succeed( /"x"/ )
+ knife("raw -z -i #{path_to("empty.json")} -m PUT /roles/x").should_succeed( /"x"/ )
knife("list --local /roles").should_succeed "/roles/x.json\n"
end
it "After knife raw -z -i rolestuff.json -m PUT /roles/x, the output is pretty" do
- knife("raw -z -i #{path_to('rolestuff.json')} -m PUT /roles/x").should_succeed( /"x"/ )
+ knife("raw -z -i #{path_to("rolestuff.json")} -m PUT /roles/x").should_succeed( /"x"/ )
expect(IO.read(path_to("roles/x.json"))).to eq <<~EOM.strip
{
"name": "x",
@@ -242,12 +242,12 @@ describe "ChefFSDataStore tests", :workstation do
end
it "knife raw -z -i empty.json -m POST /clients" do
- knife("raw -z -i #{path_to('empty.json')} -m POST /clients").should_succeed( /uri/ )
+ knife("raw -z -i #{path_to("empty.json")} -m POST /clients").should_succeed( /uri/ )
knife("list --local /clients").should_succeed "/clients/z.json\n"
end
it "knife cookbook upload works" do
- knife("cookbook upload -z --cookbook-path #{path_to('cookbooks_to_upload')} z").should_succeed stderr: <<~EOM
+ knife("cookbook upload -z --cookbook-path #{path_to("cookbooks_to_upload")} z").should_succeed stderr: <<~EOM
Uploading z [1.0.0]
Uploaded 1 cookbook.
EOM
@@ -255,34 +255,34 @@ describe "ChefFSDataStore tests", :workstation do
end
it "knife raw -z -i empty.json -m POST /data" do
- knife("raw -z -i #{path_to('empty.json')} -m POST /data").should_succeed( /uri/ )
+ knife("raw -z -i #{path_to("empty.json")} -m POST /data").should_succeed( /uri/ )
knife("list --local -Rfp /data_bags").should_succeed "/data_bags/z/\n"
end
it "knife raw -z -i empty.json -m POST /data/x" do
- knife("raw -z -i #{path_to('empty_x.json')} -m POST /data").should_succeed( /uri/ )
- knife("raw -z -i #{path_to('empty_id.json')} -m POST /data/x").should_succeed( /"z"/ )
+ knife("raw -z -i #{path_to("empty_x.json")} -m POST /data").should_succeed( /uri/ )
+ knife("raw -z -i #{path_to("empty_id.json")} -m POST /data/x").should_succeed( /"z"/ )
knife("list --local -Rfp /data_bags").should_succeed "/data_bags/x/\n/data_bags/x/z.json\n"
end
it "knife raw -z -i empty.json -m POST /environments" do
- knife("raw -z -i #{path_to('empty.json')} -m POST /environments").should_succeed( /uri/ )
+ knife("raw -z -i #{path_to("empty.json")} -m POST /environments").should_succeed( /uri/ )
knife("list --local /environments").should_succeed "/environments/z.json\n"
end
it "knife raw -z -i dummynode.json -m POST /nodes" do
- knife("raw -z -i #{path_to('dummynode.json')} -m POST /nodes").should_succeed( /uri/ )
+ knife("raw -z -i #{path_to("dummynode.json")} -m POST /nodes").should_succeed( /uri/ )
knife("list --local /nodes").should_succeed "/nodes/z.json\n"
knife("show -z /nodes/z.json").should_succeed(/"bar"/)
end
it "knife raw -z -i empty.json -m POST /roles" do
- knife("raw -z -i #{path_to('empty.json')} -m POST /roles").should_succeed( /uri/ )
+ knife("raw -z -i #{path_to("empty.json")} -m POST /roles").should_succeed( /uri/ )
knife("list --local /roles").should_succeed "/roles/z.json\n"
end
it "After knife raw -z -i rolestuff.json -m POST /roles, the output is pretty" do
- knife("raw -z -i #{path_to('rolestuff.json')} -m POST /roles").should_succeed( /uri/ )
+ knife("raw -z -i #{path_to("rolestuff.json")} -m POST /roles").should_succeed( /uri/ )
expect(IO.read(path_to("roles/x.json"))).to eq <<~EOM.strip
{
"name": "x",
@@ -388,23 +388,23 @@ describe "ChefFSDataStore tests", :workstation do
end
it "knife raw -z -i empty.json -m PUT /clients/x fails with 404" do
- knife("raw -z -i #{path_to('empty.json')} -m PUT /clients/x").should_fail( /404/ )
+ knife("raw -z -i #{path_to("empty.json")} -m PUT /clients/x").should_fail( /404/ )
end
it "knife raw -z -i empty.json -m PUT /data/x/y fails with 404" do
- knife("raw -z -i #{path_to('empty.json')} -m PUT /data/x/y").should_fail( /404/ )
+ knife("raw -z -i #{path_to("empty.json")} -m PUT /data/x/y").should_fail( /404/ )
end
it "knife raw -z -i empty.json -m PUT /environments/x fails with 404" do
- knife("raw -z -i #{path_to('empty.json')} -m PUT /environments/x").should_fail( /404/ )
+ knife("raw -z -i #{path_to("empty.json")} -m PUT /environments/x").should_fail( /404/ )
end
it "knife raw -z -i empty.json -m PUT /nodes/x fails with 404" do
- knife("raw -z -i #{path_to('empty.json')} -m PUT /nodes/x").should_fail( /404/ )
+ knife("raw -z -i #{path_to("empty.json")} -m PUT /nodes/x").should_fail( /404/ )
end
it "knife raw -z -i empty.json -m PUT /roles/x fails with 404" do
- knife("raw -z -i #{path_to('empty.json')} -m PUT /roles/x").should_fail( /404/ )
+ knife("raw -z -i #{path_to("empty.json")} -m PUT /roles/x").should_fail( /404/ )
end
end
@@ -485,12 +485,12 @@ describe "ChefFSDataStore tests", :workstation do
end
it "knife raw -z -i empty.json -m PUT /users/x" do
- knife("raw -z -i #{path_to('empty.json')} -m PUT /users/x").should_succeed( /"x"/ )
+ knife("raw -z -i #{path_to("empty.json")} -m PUT /users/x").should_succeed( /"x"/ )
knife("list --local /users").should_succeed "/users/x.json\n"
end
it "After knife raw -z -i rolestuff.json -m PUT /roles/x, the output is pretty" do
- knife("raw -z -i #{path_to('rolestuff.json')} -m PUT /roles/x").should_succeed( /"x"/ )
+ knife("raw -z -i #{path_to("rolestuff.json")} -m PUT /roles/x").should_succeed( /"x"/ )
expect(IO.read(path_to("roles/x.json"))).to eq <<~EOM.strip
{
"name": "x",
@@ -513,7 +513,7 @@ describe "ChefFSDataStore tests", :workstation do
end
it "knife raw -z -i empty.json -m POST /users" do
- knife("raw -z -i #{path_to('empty.json')} -m POST /users").should_succeed( /uri/ )
+ knife("raw -z -i #{path_to("empty.json")} -m POST /users").should_succeed( /uri/ )
knife("list --local /users").should_succeed "/users/z.json\n"
end
end
@@ -548,7 +548,7 @@ describe "ChefFSDataStore tests", :workstation do
end
it "knife raw -z -i empty.json -m PUT /users/x fails with 404" do
- knife("raw -z -i #{path_to('empty.json')} -m PUT /users/x").should_fail( /404/ )
+ knife("raw -z -i #{path_to("empty.json")} -m PUT /users/x").should_fail( /404/ )
end
end
end
diff --git a/spec/integration/knife/chef_repo_path_spec.rb b/spec/integration/knife/chef_repo_path_spec.rb
index 4a133b0181..919741f930 100644
--- a/spec/integration/knife/chef_repo_path_spec.rb
+++ b/spec/integration/knife/chef_repo_path_spec.rb
@@ -59,7 +59,7 @@ describe "chef_repo_path tests", :workstation do
it "knife list --local -Rfp --chef-repo-path chef_repo2 / grabs chef_repo2 stuff" do
Chef::Config.delete(:chef_repo_path)
- knife("list --local -Rfp --chef-repo-path #{path_to('chef_repo2')} /").should_succeed <<~EOM
+ knife("list --local -Rfp --chef-repo-path #{path_to("chef_repo2")} /").should_succeed <<~EOM
/clients/
/clients/client3.json
/cookbooks/
@@ -81,7 +81,7 @@ describe "chef_repo_path tests", :workstation do
it "knife list --local -Rfp --chef-repo-path chef_r~1 / grabs chef_repo2 stuff", :windows_only do
Chef::Config.delete(:chef_repo_path)
- knife("list --local -Rfp --chef-repo-path #{path_to('chef_r~1')} /").should_succeed <<~EOM
+ knife("list --local -Rfp --chef-repo-path #{path_to("chef_r~1")} /").should_succeed <<~EOM
/clients/
/clients/client3.json
/cookbooks/
@@ -103,7 +103,7 @@ describe "chef_repo_path tests", :workstation do
it "knife list --local -Rfp --chef-repo-path chef_r~1 / grabs chef_repo2 stuff", :windows_only do
Chef::Config.delete(:chef_repo_path)
- knife("list -z -Rfp --chef-repo-path #{path_to('chef_r~1')} /").should_succeed <<~EOM
+ knife("list -z -Rfp --chef-repo-path #{path_to("chef_r~1")} /").should_succeed <<~EOM
/acls/
/acls/clients/
/acls/clients/client3.json
@@ -157,7 +157,7 @@ describe "chef_repo_path tests", :workstation do
end
it "knife list --local -Rfp --chef-repo-path chef_repo2 / grabs chef_repo2 stuff" do
- knife("list --local -Rfp --chef-repo-path #{path_to('chef_repo2')} /").should_succeed <<~EOM
+ knife("list --local -Rfp --chef-repo-path #{path_to("chef_repo2")} /").should_succeed <<~EOM
/clients/
/clients/client3.json
/cookbooks/
diff --git a/spec/integration/knife/cookbook_api_ipv6_spec.rb b/spec/integration/knife/cookbook_api_ipv6_spec.rb
index a7e3709276..c615d8de7a 100644
--- a/spec/integration/knife/cookbook_api_ipv6_spec.rb
+++ b/spec/integration/knife/cookbook_api_ipv6_spec.rb
@@ -77,7 +77,7 @@ describe "Knife cookbook API integration with IPv6", :workstation, :not_supporte
<<~END_CLIENT_RB
chef_server_url "http://[::1]:8900"
syntax_check_cache_path '#{cache_path}'
- client_key '#{path_to('config/knifeuser.pem')}'
+ client_key '#{path_to("config/knifeuser.pem")}'
node_name 'whoisthisis'
cookbook_path '#{CHEF_SPEC_DATA}/cookbooks'
END_CLIENT_RB
diff --git a/spec/integration/knife/diff_spec.rb b/spec/integration/knife/diff_spec.rb
index cd08ebdcbd..87cbd1559d 100644
--- a/spec/integration/knife/diff_spec.rb
+++ b/spec/integration/knife/diff_spec.rb
@@ -309,7 +309,7 @@ describe "knife diff", :workstation do
when_the_repository "has an environment with bad JSON" do
before { file "environments/x.json", "{" }
it "knife diff reports an error and does a textual diff" do
- error_text = "WARN: Parse error reading #{path_to('environments/x.json')} as JSON: parse error: premature EOF"
+ error_text = "WARN: Parse error reading #{path_to("environments/x.json")} as JSON: parse error: premature EOF"
error_match = Regexp.new(Regexp.escape(error_text))
knife("diff /environments/x.json").should_succeed(/- "name": "x"/, stderr: error_match)
end
@@ -592,7 +592,7 @@ describe "knife diff", :workstation do
when_the_repository "has an environment with bad JSON" do
before { file "environments/x.json", "{" }
it "knife diff reports an error and does a textual diff" do
- error_text = "WARN: Parse error reading #{path_to('environments/x.json')} as JSON: parse error: premature EOF"
+ error_text = "WARN: Parse error reading #{path_to("environments/x.json")} as JSON: parse error: premature EOF"
error_match = Regexp.new(Regexp.escape(error_text))
knife("diff /environments/x.json").should_succeed(/- "name": "x"/, stderr: error_match)
end
diff --git a/spec/integration/knife/download_spec.rb b/spec/integration/knife/download_spec.rb
index 93d804b749..77f6d3890e 100644
--- a/spec/integration/knife/download_spec.rb
+++ b/spec/integration/knife/download_spec.rb
@@ -561,7 +561,7 @@ describe "knife download", :workstation do
end
it "knife download succeeds" do
warning = <<~EOH
- WARN: Parse error reading #{path_to('environments/x.json')} as JSON: parse error: premature EOF
+ WARN: Parse error reading #{path_to("environments/x.json")} as JSON: parse error: premature EOF
{
(right here) ------^
diff --git a/spec/integration/knife/redirection_spec.rb b/spec/integration/knife/redirection_spec.rb
index d387b10e3b..5e5ef27b9a 100644
--- a/spec/integration/knife/redirection_spec.rb
+++ b/spec/integration/knife/redirection_spec.rb
@@ -34,7 +34,7 @@ describe "redirection", :workstation do
real_chef_server_url = Chef::Config.chef_server_url
Chef::Config.chef_server_url = "http://localhost:9018"
app = lambda do |env|
- [302, { "Content-Type" => "text", "Location" => "#{real_chef_server_url}#{env['PATH_INFO']}" }, ["302 found"] ]
+ [302, { "Content-Type" => "text", "Location" => "#{real_chef_server_url}#{env["PATH_INFO"]}" }, ["302 found"] ]
end
@redirector_server_thread = start_app_server(app, 9018)
end
diff --git a/spec/integration/knife/upload_spec.rb b/spec/integration/knife/upload_spec.rb
index 766f91ab25..1a6ddceb17 100644
--- a/spec/integration/knife/upload_spec.rb
+++ b/spec/integration/knife/upload_spec.rb
@@ -636,7 +636,7 @@ EOM
it "knife upload tries and fails" do
error1 = <<~EOH
- WARN: Parse error reading #{path_to('environments/x.json')} as JSON: parse error: premature EOF
+ WARN: Parse error reading #{path_to("environments/x.json")} as JSON: parse error: premature EOF
{
(right here) ------^
@@ -646,7 +646,7 @@ EOM
EOH
warn = <<~EOH
- WARN: Parse error reading #{path_to('environments/x.json')} as JSON: parse error: premature EOF
+ WARN: Parse error reading #{path_to("environments/x.json")} as JSON: parse error: premature EOF
{
(right here) ------^
diff --git a/spec/integration/recipes/accumulator_spec.rb b/spec/integration/recipes/accumulator_spec.rb
index d19d8637bb..98e3581071 100644
--- a/spec/integration/recipes/accumulator_spec.rb
+++ b/spec/integration/recipes/accumulator_spec.rb
@@ -115,11 +115,11 @@ describe "Accumulators" do
it "should complete with success" do
file "config/client.rb", <<-EOM
local_mode true
- cookbook_path "#{path_to('cookbooks')}"
+ cookbook_path "#{path_to("cookbooks")}"
log_level :warn
EOM
- result = shell_out("#{chef_client} -c \"#{path_to('config/client.rb')}\" --no-color -F doc -o 'x::default'", cwd: chef_dir)
+ result = shell_out("#{chef_client} -c \"#{path_to("config/client.rb")}\" --no-color -F doc -o 'x::default'", cwd: chef_dir)
result.error!
# runs only a single template resource (in the outer run context, as a delayed resource)
expect(result.stdout.scan(/template\S+ action create/).size).to eql(1)
@@ -217,11 +217,11 @@ describe "Accumulators" do
it "should complete with success" do
file "config/client.rb", <<-EOM
local_mode true
- cookbook_path "#{path_to('cookbooks')}"
+ cookbook_path "#{path_to("cookbooks")}"
log_level :warn
EOM
- result = shell_out("#{chef_client} -c \"#{path_to('config/client.rb')}\" --no-color -F doc -o 'x::default'", cwd: chef_dir)
+ result = shell_out("#{chef_client} -c \"#{path_to("config/client.rb")}\" --no-color -F doc -o 'x::default'", cwd: chef_dir)
result.error!
# runs only a single template resource (in the outer run context, as a delayed resource)
expect(result.stdout.scan(/template\S+ action create/).size).to eql(1)
diff --git a/spec/integration/recipes/lwrp_inline_resources_spec.rb b/spec/integration/recipes/lwrp_inline_resources_spec.rb
index d978a18e3e..75516203b3 100644
--- a/spec/integration/recipes/lwrp_inline_resources_spec.rb
+++ b/spec/integration/recipes/lwrp_inline_resources_spec.rb
@@ -147,11 +147,11 @@ describe "LWRPs with inline resources" do
it "should complete with success" do
file "config/client.rb", <<~EOM
local_mode true
- cookbook_path "#{path_to('cookbooks')}"
+ cookbook_path "#{path_to("cookbooks")}"
log_level :warn
EOM
- result = shell_out("#{chef_client} -c \"#{path_to('config/client.rb')}\" --no-color -F doc -o 'x::default'", cwd: chef_dir)
+ result = shell_out("#{chef_client} -c \"#{path_to("config/client.rb")}\" --no-color -F doc -o 'x::default'", cwd: chef_dir)
actual = result.stdout.lines.map { |l| l.chomp }.join("\n")
expected = <<EOM
* x_my_machine[me] action create
diff --git a/spec/integration/recipes/lwrp_spec.rb b/spec/integration/recipes/lwrp_spec.rb
index ce2861d43b..957c1ea66f 100644
--- a/spec/integration/recipes/lwrp_spec.rb
+++ b/spec/integration/recipes/lwrp_spec.rb
@@ -40,11 +40,11 @@ describe "LWRPs" do
it "should complete with success" do
file "config/client.rb", <<~EOM
local_mode true
- cookbook_path "#{path_to('cookbooks')}"
+ cookbook_path "#{path_to("cookbooks")}"
log_level :warn
EOM
- result = shell_out("#{chef_client} -c \"#{path_to('config/client.rb')}\" --no-color -F doc -o 'l-w-r-p::default'", cwd: chef_dir)
+ result = shell_out("#{chef_client} -c \"#{path_to("config/client.rb")}\" --no-color -F doc -o 'l-w-r-p::default'", cwd: chef_dir)
expect(result.stdout).to match(/\* l_w_r_p_foo\[me\] action create \(up to date\)/)
expect(result.stdout).not_to match(/WARN: You are overriding l_w_r_p_foo/)
result.error!
diff --git a/spec/integration/recipes/notifies_spec.rb b/spec/integration/recipes/notifies_spec.rb
index 860a109e4d..ae534dcad4 100644
--- a/spec/integration/recipes/notifies_spec.rb
+++ b/spec/integration/recipes/notifies_spec.rb
@@ -28,11 +28,11 @@ describe "notifications" do
it "should complete with success" do
file "config/client.rb", <<~EOM
local_mode true
- cookbook_path "#{path_to('cookbooks')}"
+ cookbook_path "#{path_to("cookbooks")}"
log_level :warn
EOM
- result = shell_out("#{chef_client} -c \"#{path_to('config/client.rb')}\" --no-color -F doc -o 'x::default'", cwd: chef_dir)
+ result = shell_out("#{chef_client} -c \"#{path_to("config/client.rb")}\" --no-color -F doc -o 'x::default'", cwd: chef_dir)
# our delayed notification should run at the end of the parent run_context after the baz resource
expect(result.stdout).to match(/\* apt_update\[\] action nothing \(skipped due to action :nothing\)\s+\* log\[foo\] action write\s+\* log\[bar\] action write\s+\* apt_update\[\] action nothing \(skipped due to action :nothing\)/)
result.error!
@@ -69,11 +69,11 @@ describe "notifications" do
it "should complete with success" do
file "config/client.rb", <<~EOM
local_mode true
- cookbook_path "#{path_to('cookbooks')}"
+ cookbook_path "#{path_to("cookbooks")}"
log_level :warn
EOM
- result = shell_out("#{chef_client} -c \"#{path_to('config/client.rb')}\" --no-color -F doc -o 'x::default'", cwd: chef_dir)
+ result = shell_out("#{chef_client} -c \"#{path_to("config/client.rb")}\" --no-color -F doc -o 'x::default'", cwd: chef_dir)
# our delayed notification should run at the end of the parent run_context after the baz resource
expect(result.stdout).to match(/\* log\[bar\] action write\s+\* log\[baz\] action write\s+\* log\[foo\] action write/)
result.error!
@@ -112,11 +112,11 @@ describe "notifications" do
it "should complete with success" do
file "config/client.rb", <<~EOM
local_mode true
- cookbook_path "#{path_to('cookbooks')}"
+ cookbook_path "#{path_to("cookbooks")}"
log_level :warn
EOM
- result = shell_out("#{chef_client} -c \"#{path_to('config/client.rb')}\" --no-color -F doc -o 'x::default'", cwd: chef_dir)
+ result = shell_out("#{chef_client} -c \"#{path_to("config/client.rb")}\" --no-color -F doc -o 'x::default'", cwd: chef_dir)
# our delayed notification should run at the end of the parent run_context after the baz resource
expect(result.stdout).to match(/\* log\[bar\] action write\s+\* log\[baz\] action write\s+\* log\[foo\] action write/)
# and only run once
@@ -159,11 +159,11 @@ describe "notifications" do
it "should complete with success" do
file "config/client.rb", <<~EOM
local_mode true
- cookbook_path "#{path_to('cookbooks')}"
+ cookbook_path "#{path_to("cookbooks")}"
log_level :warn
EOM
- result = shell_out("#{chef_client} -c \"#{path_to('config/client.rb')}\" --no-color -F doc -o 'x::default'", cwd: chef_dir)
+ result = shell_out("#{chef_client} -c \"#{path_to("config/client.rb")}\" --no-color -F doc -o 'x::default'", cwd: chef_dir)
# the delayed notification from the sub-resource is de-duplicated by the notification already in the parent run_context
expect(result.stdout).to match(/\* log\[quux\] action write\s+\* notifying_test\[whatever\] action run\s+\* log\[bar\] action write\s+\* log\[baz\] action write\s+\* log\[foo\] action write\s+\* log\[baz\] action write/)
# and only run once
@@ -193,11 +193,11 @@ describe "notifications" do
it "should complete with success" do
file "config/client.rb", <<~EOM
local_mode true
- cookbook_path "#{path_to('cookbooks')}"
+ cookbook_path "#{path_to("cookbooks")}"
log_level :warn
EOM
- result = shell_out("#{chef_client} -c \"#{path_to('config/client.rb')}\" --no-color -F doc -o 'x::default'", cwd: chef_dir)
+ result = shell_out("#{chef_client} -c \"#{path_to("config/client.rb")}\" --no-color -F doc -o 'x::default'", cwd: chef_dir)
# the delayed notification from the sub-resource is de-duplicated by the notification already in the parent run_context
expect(result.stdout).to match(/\* log\[bar\] action write\s+\* log\[baz\] action write\s+\* log\[foo\] action write/)
# and only run once
@@ -236,11 +236,11 @@ describe "notifications" do
it "should complete with success" do
file "config/client.rb", <<~EOM
local_mode true
- cookbook_path "#{path_to('cookbooks')}"
+ cookbook_path "#{path_to("cookbooks")}"
log_level :warn
EOM
- result = shell_out("#{chef_client} -c \"#{path_to('config/client.rb')}\" --no-color -F doc -o 'x::default'", cwd: chef_dir)
+ result = shell_out("#{chef_client} -c \"#{path_to("config/client.rb")}\" --no-color -F doc -o 'x::default'", cwd: chef_dir)
expect(result.stdout).to match(/\* log\[bar\] action write\s+\* log\[foo\] action write\s+\* log\[baz\] action write/)
result.error!
end
@@ -276,11 +276,11 @@ describe "notifications" do
it "should complete with success" do
file "config/client.rb", <<~EOM
local_mode true
- cookbook_path "#{path_to('cookbooks')}"
+ cookbook_path "#{path_to("cookbooks")}"
log_level :warn
EOM
- result = shell_out("#{chef_client} -c \"#{path_to('config/client.rb')}\" --no-color -F doc -o 'x::default'", cwd: chef_dir)
+ result = shell_out("#{chef_client} -c \"#{path_to("config/client.rb")}\" --no-color -F doc -o 'x::default'", cwd: chef_dir)
expect(result.stdout).to match(/\* log\[bar\] action write\s+\* log\[foo\] action write\s+\* log\[baz\] action write/)
result.error!
end
@@ -313,11 +313,11 @@ describe "notifications" do
it "should complete with success" do
file "config/client.rb", <<~EOM
local_mode true
- cookbook_path "#{path_to('cookbooks')}"
+ cookbook_path "#{path_to("cookbooks")}"
log_level :warn
EOM
- result = shell_out("#{chef_client} -c \"#{path_to('config/client.rb')}\" --no-color -F doc -o 'x::default'", cwd: chef_dir)
+ result = shell_out("#{chef_client} -c \"#{path_to("config/client.rb")}\" --no-color -F doc -o 'x::default'", cwd: chef_dir)
expect(result.stdout).to match(/Chef::Exceptions::ResourceNotFound/)
expect(result.exitstatus).not_to eql(0)
end
@@ -353,11 +353,11 @@ describe "notifications" do
it "should complete with success" do
file "config/client.rb", <<~EOM
local_mode true
- cookbook_path "#{path_to('cookbooks')}"
+ cookbook_path "#{path_to("cookbooks")}"
log_level :warn
EOM
- result = shell_out("#{chef_client} -c \"#{path_to('config/client.rb')}\" --no-color -F doc -o 'x::default'", cwd: chef_dir)
+ result = shell_out("#{chef_client} -c \"#{path_to("config/client.rb")}\" --no-color -F doc -o 'x::default'", cwd: chef_dir)
expect(result.stdout).not_to match(/CHEF-3694/)
result.error!
end
@@ -381,11 +381,11 @@ describe "notifications" do
it "notifying the resource should work" do
file "config/client.rb", <<~EOM
local_mode true
- cookbook_path "#{path_to('cookbooks')}"
+ cookbook_path "#{path_to("cookbooks")}"
log_level :warn
EOM
- result = shell_out("#{chef_client} -c \"#{path_to('config/client.rb')}\" --no-color -F doc -o 'x::default'", cwd: chef_dir)
+ result = shell_out("#{chef_client} -c \"#{path_to("config/client.rb")}\" --no-color -F doc -o 'x::default'", cwd: chef_dir)
expect(result.stdout).to match /\* log\[a, b\] action write/
result.error!
end
diff --git a/spec/integration/recipes/notifying_block_spec.rb b/spec/integration/recipes/notifying_block_spec.rb
index 753e81dadb..465eca97ed 100644
--- a/spec/integration/recipes/notifying_block_spec.rb
+++ b/spec/integration/recipes/notifying_block_spec.rb
@@ -45,7 +45,7 @@ describe "notifying_block" do
end
file "config/client.rb", <<-EOM
local_mode true
- cookbook_path "#{path_to('cookbooks')}"
+ cookbook_path "#{path_to("cookbooks")}"
log_level :warn
EOM
end
@@ -55,7 +55,7 @@ describe "notifying_block" do
# 2. delayed notifications are de-dup'd in the subcontext
# 3. delayed notifications (to resources inside the subcontext) are run at the end of the subcontext
it "should run alpha, beta, gamma, and delta in that order" do
- result = shell_out("#{chef_client} -c \"#{path_to('config/client.rb')}\" --no-color -F doc -o 'x::default'", cwd: chef_dir)
+ result = shell_out("#{chef_client} -c \"#{path_to("config/client.rb")}\" --no-color -F doc -o 'x::default'", cwd: chef_dir)
expect(result.stdout).to match(/\* log\[alpha\] action write\s+\* log\[beta\] action write\s+\* log\[gamma\] action write\s+Converging 1 resources\s+\* log\[delta\] action write/)
result.error!
end
@@ -94,7 +94,7 @@ describe "notifying_block" do
end
file "config/client.rb", <<-EOM
local_mode true
- cookbook_path "#{path_to('cookbooks')}"
+ cookbook_path "#{path_to("cookbooks")}"
log_level :warn
EOM
end
@@ -103,7 +103,7 @@ describe "notifying_block" do
# 1. notifying block will correctly update wrapping new_resource updated_by_last_action status
# 2. delayed notifications from a subcontext inside a resource will notify resources in their outer run_context
it "should run foo, quux, bar, and baz in that order" do
- result = shell_out("#{chef_client} -c \"#{path_to('config/client.rb')}\" --no-color -F doc -o 'x::default'", cwd: chef_dir)
+ result = shell_out("#{chef_client} -c \"#{path_to("config/client.rb")}\" --no-color -F doc -o 'x::default'", cwd: chef_dir)
expect(result.stdout).to match(/\* log\[foo\] action write\s+\* log\[quux\] action write\s+\* log\[bar\] action write\s+\* log\[baz\] action write/)
result.error!
end
diff --git a/spec/integration/recipes/remote_directory.rb b/spec/integration/recipes/remote_directory.rb
index 6f67a38fc8..8332fb1b56 100644
--- a/spec/integration/recipes/remote_directory.rb
+++ b/spec/integration/recipes/remote_directory.rb
@@ -22,7 +22,7 @@ describe Chef::Resource::RemoteDirectory do
before do
file "config/client.rb", <<-EOM
local_mode true
- cookbook_path "#{path_to('cookbooks')}"
+ cookbook_path "#{path_to("cookbooks")}"
EOM
directory "cookbooks/test" do
directory "files/default/source_dir" do
@@ -50,7 +50,7 @@ describe Chef::Resource::RemoteDirectory do
end
EOM
end
- shell_out!("#{chef_client} -c \"#{path_to('config/client.rb')}\" -o 'test::default'", cwd: chef_dir)
+ shell_out!("#{chef_client} -c \"#{path_to("config/client.rb")}\" -o 'test::default'", cwd: chef_dir)
end
def mode_of(path)
diff --git a/spec/integration/solo/solo_spec.rb b/spec/integration/solo/solo_spec.rb
index 0d24269199..451943e225 100644
--- a/spec/integration/solo/solo_spec.rb
+++ b/spec/integration/solo/solo_spec.rb
@@ -27,7 +27,7 @@ describe Chef::Dist::SOLOEXEC do
file "config/solo.rb", <<~EOM
chef_repo_path "#{@repository_dir}"
EOM
- result = shell_out("bundle exec chef-solo -c \"#{path_to('config/solo.rb')}\" -l debug", cwd: chef_dir)
+ result = shell_out("bundle exec chef-solo -c \"#{path_to("config/solo.rb")}\" -l debug", cwd: chef_dir)
result.error!
end
@@ -76,25 +76,25 @@ describe Chef::Dist::SOLOEXEC do
it "should complete with success" do
file "config/solo.rb", <<~EOM
- cookbook_path "#{path_to('cookbooks')}"
- file_cache_path "#{path_to('config/cache')}"
+ cookbook_path "#{path_to("cookbooks")}"
+ file_cache_path "#{path_to("config/cache")}"
EOM
- result = shell_out("#{chef_solo} -c \"#{path_to('config/solo.rb')}\" -o 'x::default' -l debug", cwd: chef_dir)
+ result = shell_out("#{chef_solo} -c \"#{path_to("config/solo.rb")}\" -o 'x::default' -l debug", cwd: chef_dir)
result.error!
expect(result.stdout).to include("ITWORKS")
end
it "should evaluate its node.json file" do
file "config/solo.rb", <<~EOM
- cookbook_path "#{path_to('cookbooks')}"
- file_cache_path "#{path_to('config/cache')}"
+ cookbook_path "#{path_to("cookbooks")}"
+ file_cache_path "#{path_to("config/cache")}"
EOM
file "config/node.json", <<~E
{"run_list":["x::default"]}
E
- result = shell_out("#{chef_solo} -c \"#{path_to('config/solo.rb')}\" -j '#{path_to('config/node.json')}' -l debug", cwd: chef_dir)
+ result = shell_out("#{chef_solo} -c \"#{path_to("config/solo.rb")}\" -j '#{path_to("config/node.json")}' -l debug", cwd: chef_dir)
result.error!
expect(result.stdout).to include("ITWORKS")
end
@@ -112,10 +112,10 @@ describe Chef::Dist::SOLOEXEC do
it "should exit with an error" do
file "config/solo.rb", <<~EOM
- cookbook_path "#{path_to('cookbooks')}"
- file_cache_path "#{path_to('config/cache')}"
+ cookbook_path "#{path_to("cookbooks")}"
+ file_cache_path "#{path_to("config/cache")}"
EOM
- result = shell_out("#{chef_solo} -c \"#{path_to('config/solo.rb')}\" -o 'x::default' -l debug", cwd: chef_dir)
+ result = shell_out("#{chef_solo} -c \"#{path_to("config/solo.rb")}\" -o 'x::default' -l debug", cwd: chef_dir)
expect(result.exitstatus).to eq(0) # For CHEF-5120 this becomes 1
expect(result.stdout).to include("WARN: MissingCookbookDependency")
end
@@ -126,13 +126,13 @@ describe Chef::Dist::SOLOEXEC do
file "cookbooks/x/metadata.rb", cb_metadata("x", "1.0.0", "\nchef_version '~> 999.0'")
file "cookbooks/x/recipes/default.rb", 'puts "ITWORKS"'
file "config/solo.rb", <<~EOM
- cookbook_path "#{path_to('cookbooks')}"
- file_cache_path "#{path_to('config/cache')}"
+ cookbook_path "#{path_to("cookbooks")}"
+ file_cache_path "#{path_to("config/cache")}"
EOM
end
it "should exit with an error" do
- result = shell_out("#{chef_solo} -c \"#{path_to('config/solo.rb')}\" -o 'x::default' -l debug", cwd: chef_dir)
+ result = shell_out("#{chef_solo} -c \"#{path_to("config/solo.rb")}\" -o 'x::default' -l debug", cwd: chef_dir)
expect(result.exitstatus).to eq(1)
expect(result.stdout).to include("Chef::Exceptions::CookbookChefVersionMismatch")
end
@@ -143,13 +143,13 @@ describe Chef::Dist::SOLOEXEC do
file "cookbooks/x/metadata.rb", cb_metadata("x", "1.0.0", "\nohai_version '~> 999.0'")
file "cookbooks/x/recipes/default.rb", 'puts "ITWORKS"'
file "config/solo.rb", <<~EOM
- cookbook_path "#{path_to('cookbooks')}"
- file_cache_path "#{path_to('config/cache')}"
+ cookbook_path "#{path_to("cookbooks")}"
+ file_cache_path "#{path_to("config/cache")}"
EOM
end
it "should exit with an error" do
- result = shell_out("#{chef_solo} -c \"#{path_to('config/solo.rb')}\" -o 'x::default' -l debug", cwd: chef_dir)
+ result = shell_out("#{chef_solo} -c \"#{path_to("config/solo.rb")}\" -o 'x::default' -l debug", cwd: chef_dir)
expect(result.exitstatus).to eq(1)
expect(result.stdout).to include("Chef::Exceptions::CookbookOhaiVersionMismatch")
end
@@ -175,8 +175,8 @@ describe Chef::Dist::SOLOEXEC do
it "while running solo concurrently" do
file "config/solo.rb", <<~EOM
- cookbook_path "#{path_to('cookbooks')}"
- file_cache_path "#{path_to('config/cache')}"
+ cookbook_path "#{path_to("cookbooks")}"
+ file_cache_path "#{path_to("config/cache")}"
EOM
# We have a timeout protection here so that if due to some bug
# run_lock gets stuck we can discover it.
@@ -188,13 +188,13 @@ describe Chef::Dist::SOLOEXEC do
# Instantiate the first chef-solo run
threads << Thread.new do
- s1 = Process.spawn("#{chef_solo} -c \"#{path_to('config/solo.rb')}\" -o 'x::default' -l debug -L #{path_to('logs/runs.log')}", chdir: chef_dir)
+ s1 = Process.spawn("#{chef_solo} -c \"#{path_to("config/solo.rb")}\" -o 'x::default' -l debug -L #{path_to("logs/runs.log")}", chdir: chef_dir)
Process.waitpid(s1)
end
# Instantiate the second chef-solo run
threads << Thread.new do
- s2 = Process.spawn("#{chef_solo} -c \"#{path_to('config/solo.rb')}\" -o 'x::default' -l debug -L #{path_to('logs/runs.log')}", chdir: chef_dir)
+ s2 = Process.spawn("#{chef_solo} -c \"#{path_to("config/solo.rb")}\" -o 'x::default' -l debug -L #{path_to("logs/runs.log")}", chdir: chef_dir)
Process.waitpid(s2)
end
diff --git a/spec/support/platforms/win32/spec_service.rb b/spec/support/platforms/win32/spec_service.rb
index 7398cfbd96..2cc4e40298 100644
--- a/spec/support/platforms/win32/spec_service.rb
+++ b/spec/support/platforms/win32/spec_service.rb
@@ -20,7 +20,7 @@ require "win32/daemon"
class SpecService < ::Win32::Daemon
def service_init
- @test_service_file = "#{ENV['TMP']}/spec_service_file"
+ @test_service_file = "#{ENV["TMP"]}/spec_service_file"
end
def service_main(*startup_parameters)
diff --git a/spec/support/shared/functional/execute_resource.rb b/spec/support/shared/functional/execute_resource.rb
index e5639f1614..f56479bb49 100644
--- a/spec/support/shared/functional/execute_resource.rb
+++ b/spec/support/shared/functional/execute_resource.rb
@@ -21,7 +21,7 @@ shared_context "a non-admin Windows user" do
let(:windows_nonadmin_user_domain) { ENV["COMPUTERNAME"] }
let(:windows_nonadmin_user_qualified) { "#{windows_nonadmin_user_domain}\\#{windows_nonadmin_user}" }
- let(:temp_profile_path) { "#{ENV['USERPROFILE']}\\..\\cheftesttempuser" }
+ let(:temp_profile_path) { "#{ENV["USERPROFILE"]}\\..\\cheftesttempuser" }
before do
shell_out!("net.exe user /delete #{windows_nonadmin_user}", returns: [0, 2])
@@ -40,7 +40,7 @@ end
shared_context "alternate user identity" do
let(:windows_alternate_user) { "chef%02d%02d%02d" % [Time.now.year % 100, Time.now.month, Time.now.day] }
let(:windows_alternate_user_password) { "lj28;fx3T!x,2" }
- let(:windows_alternate_user_qualified) { "#{ENV['COMPUTERNAME']}\\#{windows_alternate_user}" }
+ let(:windows_alternate_user_qualified) { "#{ENV["COMPUTERNAME"]}\\#{windows_alternate_user}" }
let(:windows_nonadmin_user) { windows_alternate_user }
let(:windows_nonadmin_user_password) { windows_alternate_user_password }
@@ -73,7 +73,7 @@ shared_examples_for "an execute resource that supports alternate user identity"
include_context "a command that can be executed as an alternate user"
let(:windows_current_user) { ENV["USERNAME"] }
- let(:windows_current_user_qualified) { "#{ENV['USERDOMAIN'] || ENV['COMPUTERNAME']}\\#{windows_current_user}" }
+ let(:windows_current_user_qualified) { "#{ENV["USERDOMAIN"] || ENV["COMPUTERNAME"]}\\#{windows_current_user}" }
let(:resource_identity_command) { "powershell.exe -noprofile -command \"import-module microsoft.powershell.utility;([Security.Principal.WindowsPrincipal]([Security.Principal.WindowsIdentity]::GetCurrent())).identity.name | out-file -encoding ASCII '#{script_output_path}'\"" }
let(:execute_resource) do
diff --git a/spec/support/shared/functional/securable_resource.rb b/spec/support/shared/functional/securable_resource.rb
index 18e7243453..6705c8e2d8 100644
--- a/spec/support/shared/functional/securable_resource.rb
+++ b/spec/support/shared/functional/securable_resource.rb
@@ -314,7 +314,7 @@ shared_examples_for "a securable resource without existing target" do
end
it "sets owner when owner is specified with a \\" do
- resource.owner "#{ENV['COMPUTERNAME']}\\Guest"
+ resource.owner "#{ENV["COMPUTERNAME"]}\\Guest"
resource.run_action(:create)
expect(descriptor.owner).to eq(SID.Guest)
end
diff --git a/spec/support/shared/functional/win32_service.rb b/spec/support/shared/functional/win32_service.rb
index a528db4a53..2d14c6cf86 100644
--- a/spec/support/shared/functional/win32_service.rb
+++ b/spec/support/shared/functional/win32_service.rb
@@ -52,6 +52,6 @@ shared_context "using Win32::Service" do
# for the file it creates under SYSTEM temp directory
let(:test_service_file) do
- "#{ENV['SystemDrive']}\\windows\\temp\\spec_service_file"
+ "#{ENV["SystemDrive"]}\\windows\\temp\\spec_service_file"
end
end
diff --git a/spec/support/shared/integration/knife_support.rb b/spec/support/shared/integration/knife_support.rb
index 56933537f0..07d95f17cc 100644
--- a/spec/support/shared/integration/knife_support.rb
+++ b/spec/support/shared/integration/knife_support.rb
@@ -58,7 +58,7 @@ module KnifeSupport
old_loggers = Chef::Log.loggers
old_log_level = Chef::Log.level
begin
- puts "knife: #{args.join(' ')}" if DEBUG
+ puts "knife: #{args.join(" ")}" if DEBUG
subcommand_class = Chef::Knife.subcommand_class_from(args)
subcommand_class.options = Chef::Application::Knife.options.merge(subcommand_class.options)
subcommand_class.load_deps
diff --git a/spec/tiny_server.rb b/spec/tiny_server.rb
index 948bde04f2..46820cbaae 100644
--- a/spec/tiny_server.rb
+++ b/spec/tiny_server.rb
@@ -135,7 +135,7 @@ module TinyServer
if response = response_for_request(env)
response.call
else
- debug_info = { message: "no data matches the request for #{env['REQUEST_URI']}",
+ debug_info = { message: "no data matches the request for #{env["REQUEST_URI"]}",
available_routes: @routes, request: env }
# Uncomment me for glorious debugging
# pp :not_found => debug_info
diff --git a/spec/unit/deprecated_spec.rb b/spec/unit/deprecated_spec.rb
index 4b7bfcce47..7564c042c4 100644
--- a/spec/unit/deprecated_spec.rb
+++ b/spec/unit/deprecated_spec.rb
@@ -59,7 +59,7 @@ describe Chef::Deprecated do
end
collisions = id_map.select { |k, v| v.size != 1 }
unless collisions.empty?
- raise "Found deprecation ID collisions:\n#{collisions.map { |k, v| "* #{k} #{v.map(&:name).join(', ')}" }.join("\n")}"
+ raise "Found deprecation ID collisions:\n#{collisions.map { |k, v| "* #{k} #{v.map(&:name).join(", ")}" }.join("\n")}"
end
end
end
diff --git a/spec/unit/node_spec.rb b/spec/unit/node_spec.rb
index c170d4730e..1c84278ad5 100644
--- a/spec/unit/node_spec.rb
+++ b/spec/unit/node_spec.rb
@@ -769,7 +769,7 @@ describe Chef::Node do
it "caches both strings and symbols correctly" do
node.force_default[:solr][:version] = "4.10.2"
- node.force_default[:solr][:data_dir] = "/opt/solr-#{node['solr'][:version]}/example/solr"
+ node.force_default[:solr][:data_dir] = "/opt/solr-#{node["solr"][:version]}/example/solr"
node.force_default[:solr][:xms] = "512M"
expect(node[:solr][:xms]).to eql("512M")
expect(node["solr"][:xms]).to eql("512M")
@@ -778,8 +778,8 @@ describe Chef::Node do
it "method interpolation syntax also works" do
Chef::Config[:treat_deprecation_warnings_as_errors] = false
node.default["passenger"]["version"] = "4.0.57"
- node.default["passenger"]["root_path"] = "passenger-#{node['passenger']['version']}"
- node.default["passenger"]["root_path_2"] = "passenger-#{node[:passenger]['version']}"
+ node.default["passenger"]["root_path"] = "passenger-#{node["passenger"]["version"]}"
+ node.default["passenger"]["root_path_2"] = "passenger-#{node[:passenger]["version"]}"
expect(node["passenger"]["root_path_2"]).to eql("passenger-4.0.57")
expect(node[:passenger]["root_path_2"]).to eql("passenger-4.0.57")
end
diff --git a/spec/unit/provider/package/cab_spec.rb b/spec/unit/provider/package/cab_spec.rb
index 2ed40566f4..0ffbcd4a51 100644
--- a/spec/unit/provider/package/cab_spec.rb
+++ b/spec/unit/provider/package/cab_spec.rb
@@ -260,7 +260,7 @@ describe Chef::Provider::Package::Cab do
end
before do
- new_resource.source = "#{ENV['TEMP']}/test6.1-kb2664825-v3-x64.cab"
+ new_resource.source = "#{ENV["TEMP"]}/test6.1-kb2664825-v3-x64.cab"
installed_package_list_obj = double(stdout: installed_package_list_stdout)
allow(provider).to receive(:dism_command).with("/Get-Packages").and_return(installed_package_list_obj)
end
diff --git a/spec/unit/provider/package/msu_spec.rb b/spec/unit/provider/package/msu_spec.rb
index b2f0b22963..905d48649f 100644
--- a/spec/unit/provider/package/msu_spec.rb
+++ b/spec/unit/provider/package/msu_spec.rb
@@ -243,7 +243,7 @@ describe Chef::Provider::Package::Msu, :windows_only do
describe "#extract_msu_contents" do
it "extracts the msu contents by using mixlib shellout" do
- expect(provider).to receive(:shell_out!).with("#{ENV['SYSTEMROOT']}\\system32\\expand.exe -f:* msu_file destination")
+ expect(provider).to receive(:shell_out!).with("#{ENV["SYSTEMROOT"]}\\system32\\expand.exe -f:* msu_file destination")
provider.extract_msu_contents("msu_file", "destination")
end
end
diff --git a/spec/unit/resource/chef_gem_spec.rb b/spec/unit/resource/chef_gem_spec.rb
index a8429d0812..b512b8b17f 100644
--- a/spec/unit/resource/chef_gem_spec.rb
+++ b/spec/unit/resource/chef_gem_spec.rb
@@ -53,7 +53,7 @@ describe Chef::Resource::ChefGem, "gem_binary" do
end
it "sets the gem_binary based on computing it from RbConfig" do
- expect(resource.gem_binary).to eql("#{RbConfig::CONFIG['bindir']}/gem")
+ expect(resource.gem_binary).to eql("#{RbConfig::CONFIG["bindir"]}/gem")
end
it "sets compile_time to false by default" do
diff --git a/spec/unit/version_class_spec.rb b/spec/unit/version_class_spec.rb
index 9dc981bd4c..2126b18ffb 100644
--- a/spec/unit/version_class_spec.rb
+++ b/spec/unit/version_class_spec.rb
@@ -160,7 +160,7 @@ describe Chef::Version do
[ "1.2.2", :<=, "1.2.1", false ],
[ "1.2.2", :<, "1.2.1", false ],
].each do |spec|
- it "(#{spec.first(3).join(' ')}) should be #{spec[3]}" do
+ it "(#{spec.first(3).join(" ")}) should be #{spec[3]}" do
got = Chef::Version.new(spec[0]).send(spec[1],
Chef::Version.new(spec[2]))
expect(got).to eq(spec[3])