diff options
author | lamont-granquist <lamont@scriptkiddie.org> | 2014-09-10 16:30:11 -0700 |
---|---|---|
committer | lamont-granquist <lamont@scriptkiddie.org> | 2014-09-10 16:30:11 -0700 |
commit | 6ef555bed751f2b8dac01391fdff2c527d947545 (patch) | |
tree | 7d34d195f573447239d2c7f3bbb81318baa4d25f | |
parent | 7d944c37a04172daa9b9702d4822870cc439f96a (diff) | |
parent | ca152e6117fa0a9a6b494d6678ce89c8ed240953 (diff) | |
download | chef-6ef555bed751f2b8dac01391fdff2c527d947545.tar.gz |
Merge pull request #2035 from opscode/fix-configload-specs-windows
Spec fixes for Windows
-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..d1e352602d 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 |