Clean up powershell tests and add test for full path check
This commit is contained in:
parent
fe8fe55d1f
commit
cdab45424e
|
@ -63,7 +63,10 @@ describe Vagrant::Util::PowerShell do
|
||||||
end
|
end
|
||||||
|
|
||||||
context "when within WSL" do
|
context "when within WSL" do
|
||||||
before{ expect(Vagrant::Util::Platform).to receive(:wsl?).and_return(true) }
|
before do
|
||||||
|
allow(Vagrant::Util::Which).to receive(:which).with(/powershell/).and_return(nil)
|
||||||
|
expect(Vagrant::Util::Platform).to receive(:wsl?).and_return(true)
|
||||||
|
end
|
||||||
|
|
||||||
it "should check PATH with .exe extension" do
|
it "should check PATH with .exe extension" do
|
||||||
expect(Vagrant::Util::Which).to receive(:which).with("powershell.exe")
|
expect(Vagrant::Util::Which).to receive(:which).with("powershell.exe")
|
||||||
|
@ -76,9 +79,13 @@ describe Vagrant::Util::PowerShell do
|
||||||
end
|
end
|
||||||
|
|
||||||
it "should return nil when not found" do
|
it "should return nil when not found" do
|
||||||
expect(Vagrant::Util::Which).to receive(:which).with("powershell.exe").and_return(nil)
|
|
||||||
expect(described_class.executable).to be_nil
|
expect(described_class.executable).to be_nil
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it "should check for powershell with full path" do
|
||||||
|
expect(Vagrant::Util::Which).to receive(:which).with(/Windows\/System32.+powershell.exe/)
|
||||||
|
described_class.executable
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue