diff options
Diffstat (limited to 'spec/models/ssh_host_key_spec.rb')
-rw-r--r-- | spec/models/ssh_host_key_spec.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/spec/models/ssh_host_key_spec.rb b/spec/models/ssh_host_key_spec.rb index a17cd8ba345..2f613c0d785 100644 --- a/spec/models/ssh_host_key_spec.rb +++ b/spec/models/ssh_host_key_spec.rb @@ -42,8 +42,12 @@ describe SshHostKey do stdout = double(:stdout, read: stdout) stderr = double(:stderr, read: stderr) wait_thr = double(:wait_thr, value: double(success?: status)) + path = Dir.pwd + vars = { 'PWD' => path } + cmd = ['ssh-keyscan'].concat(args) + options = { chdir: path } - expect(Open3).to receive(:popen3).with({}, 'ssh-keyscan', *args).and_yield(stdin, stdout, stderr, wait_thr) + expect(Open3).to receive(:popen3).with(vars, *cmd, options).and_yield(stdin, stdout, stderr, wait_thr) stdin end |