summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2020-12-09 10:07:42 -0800
committerLamont Granquist <lamont@scriptkiddie.org>2020-12-09 10:07:42 -0800
commit22fef17e632a22908aaa5548e2dd35f9cc448a52 (patch)
tree50164c348ca5094d76ba9fc9ed8d334d0b14cbe0
parent9262ed7918c333424d8c4b324dfba40975e3c7b4 (diff)
downloadchef-22fef17e632a22908aaa5548e2dd35f9cc448a52.tar.gz
Fix via removing ENV['PWD'] from the tests
The workstation config loader will use Dir.pwd if everything is unset Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
-rw-r--r--chef-config/lib/chef-config/workstation_config_loader.rb2
-rw-r--r--spec/integration/client/client_spec.rb3
2 files changed, 2 insertions, 3 deletions
diff --git a/chef-config/lib/chef-config/workstation_config_loader.rb b/chef-config/lib/chef-config/workstation_config_loader.rb
index 2e94e4de1e..ea42211120 100644
--- a/chef-config/lib/chef-config/workstation_config_loader.rb
+++ b/chef-config/lib/chef-config/workstation_config_loader.rb
@@ -142,8 +142,6 @@ module ChefConfig
def working_directory
if ChefUtils.windows?
env["CD"]
- elsif ChefUtils.solaris2?
- Dir.pwd
else
env["PWD"]
end || Dir.pwd
diff --git a/spec/integration/client/client_spec.rb b/spec/integration/client/client_spec.rb
index 71f517141e..d95b75d8c5 100644
--- a/spec/integration/client/client_spec.rb
+++ b/spec/integration/client/client_spec.rb
@@ -97,7 +97,8 @@ describe "chef-client" do
before { file ".chef/knife.rb", "xxx.xxx" }
it "should load .chef/knife.rb when -z is specified" do
- result = shell_out("#{chef_client} -z -o 'x::default'", cwd: path_to(""))
+ # On Solaris shell_out will invoke /bin/sh which doesn't understand how to correctly update ENV['PWD']
+ result = shell_out("#{chef_client} -z -o 'x::default'", cwd: path_to(""), env: {})
# FATAL: Configuration error NoMethodError: undefined method `xxx' for nil:NilClass
expect(result.stdout).to include("xxx")
end