Stub the ssh path used for exec
Since a full path to the ssh executable is being used and is expected at a specific location, default to providing that location when looking up the executable. This prevents errors from occurring when a host system provides an `ssh` match at a different path.
This commit is contained in:
parent
5b94bbb49b
commit
e7e8a39c55
|
@ -41,6 +41,10 @@ describe Vagrant::Util::SSH do
|
|||
|
||||
let(:ssh_path) { "/usr/bin/ssh" }
|
||||
|
||||
before {
|
||||
allow(Vagrant::Util::Which).to receive(:which).with("ssh", any_args).and_return(ssh_path)
|
||||
}
|
||||
|
||||
it "searches original PATH for executable" do
|
||||
expect(Vagrant::Util::Which).to receive(:which).with("ssh", original_path: true).and_return("valid-return")
|
||||
allow(Vagrant::Util::SafeExec).to receive(:exec).and_return(nil)
|
||||
|
|
Loading…
Reference in New Issue