diff options
author | snehaldwivedi <sdwivedi@msystechnologies.com> | 2020-09-04 05:09:09 -0700 |
---|---|---|
committer | snehaldwivedi <sdwivedi@msystechnologies.com> | 2021-07-15 22:00:55 -0700 |
commit | 0d3b877e2666ba8ebb49c7006ce51bc0f40f8ea4 (patch) | |
tree | 0f948922e30d86d89ce8586d96a4a8a341d1745d /knife/spec | |
parent | 8303eb48f20b93452672bb8ce7b3f5f9b71a45bd (diff) | |
download | chef-0d3b877e2666ba8ebb49c7006ce51bc0f40f8ea4.tar.gz |
Fixed test failing on windows for create client
Signed-off-by: snehaldwivedi <sdwivedi@msystechnologies.com>
Diffstat (limited to 'knife/spec')
-rw-r--r-- | knife/spec/unit/knife/client_create_spec.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/knife/spec/unit/knife/client_create_spec.rb b/knife/spec/unit/knife/client_create_spec.rb index 48a7e71df5..3401072d6e 100644 --- a/knife/spec/unit/knife/client_create_spec.rb +++ b/knife/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 |