summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsnehaldwivedi <sdwivedi@msystechnologies.com>2020-09-04 05:09:09 -0700
committersnehaldwivedi <sdwivedi@msystechnologies.com>2021-04-04 23:00:00 -0700
commit5e6c79761f55468022c2c39cc23d1cf97c0cb2c7 (patch)
tree7c5d459a0e430794cf355e4de61ba3a98caf7b01
parentc93385fe3ad1edd8505b93cfb4bd0dbc5e6b0a35 (diff)
downloadchef-5e6c79761f55468022c2c39cc23d1cf97c0cb2c7.tar.gz
Fixed test failing on windows for create client
Signed-off-by: snehaldwivedi <sdwivedi@msystechnologies.com>
-rw-r--r--spec/unit/knife/client_create_spec.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/spec/unit/knife/client_create_spec.rb b/spec/unit/knife/client_create_spec.rb
index 48a7e71df5..3401072d6e 100644
--- a/spec/unit/knife/client_create_spec.rb
+++ b/spec/unit/knife/client_create_spec.rb
@@ -122,10 +122,12 @@ describe Chef::Knife::ClientCreate do
end
it "should write the private key to a file" do
- knife.config[:file] = "/tmp/monkeypants"
+ file = Tempfile.new
+ file_path = file.path
+ knife.config[:file] = file_path
filehandle = double("Filehandle")
expect(filehandle).to receive(:print).with("woot")
- expect(File).to receive(:open).with("/tmp/monkeypants", "w").and_yield(filehandle)
+ expect(File).to receive(:open).with(file_path, "w").and_yield(filehandle)
knife.run
end
end