diff options
-rw-r--r-- | spec/unit/workstation_config_loader_spec.rb | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/spec/unit/workstation_config_loader_spec.rb b/spec/unit/workstation_config_loader_spec.rb index 78313aec37..91b91ebbad 100644 --- a/spec/unit/workstation_config_loader_spec.rb +++ b/spec/unit/workstation_config_loader_spec.rb @@ -88,7 +88,12 @@ describe Chef::WorkstationConfigLoader do let(:env_pwd) { "/path/to/cwd" } before do - env["PWD"] = env_pwd + if Chef::Platform.windows? + env["CD"] = env_pwd + else + env["PWD"] = env_pwd + end + allow(config_loader).to receive(:path_exists?).with("#{env_pwd}/.chef/knife.rb").and_return(true) allow(File).to receive(:exist?).with("#{env_pwd}/.chef").and_return(true) allow(File).to receive(:directory?).with("#{env_pwd}/.chef").and_return(true) @@ -229,7 +234,8 @@ describe Chef::WorkstationConfigLoader do let(:config_content) { "" } let(:explicit_config_location) do - t = Tempfile.new("#{described_class}-rspec-test") + # could use described_class, but remove all ':' from the path if so. + t = Tempfile.new("Chef::WorkstationConfigLoader-rspec-test") t.print(config_content) t.close t.path |