Fix broken test; Add explicit test

Hopefully the explicit test will prevent this from being regressed again in the future
This commit is contained in:
Kierran McPherson 2016-05-04 14:00:18 +12:00 committed by Kierran McPherson
parent 3bff55034a
commit 4afe0478b8
1 changed files with 27 additions and 1 deletions

View File

@ -173,7 +173,7 @@ describe VagrantPlugins::Kernel_V2::VMConfig do
subject.communicator = "winrm"
subject.finalize!
n = subject.networks
expect(n.length).to eq(2)
expect(n.length).to eq(3)
expect(n[0][0]).to eq(:forwarded_port)
expect(n[0][1][:guest]).to eq(5985)
@ -188,6 +188,32 @@ describe VagrantPlugins::Kernel_V2::VMConfig do
expect(n[1][1][:id]).to eq("winrm-ssl")
end
it "forwards ssh even if the communicator is winrm" do
subject.communicator = "winrm"
subject.finalize!
n = subject.networks
expect(n.length).to eq(3)
expect(n[0][0]).to eq(:forwarded_port)
expect(n[0][1][:guest]).to eq(5985)
expect(n[0][1][:host]).to eq(55985)
expect(n[0][1][:host_ip]).to eq("127.0.0.1")
expect(n[0][1][:id]).to eq("winrm")
expect(n[1][0]).to eq(:forwarded_port)
expect(n[1][1][:guest]).to eq(5986)
expect(n[1][1][:host]).to eq(55986)
expect(n[1][1][:host_ip]).to eq("127.0.0.1")
expect(n[1][1][:id]).to eq("winrm-ssl")
expect(n[2][0]).to eq(:forwarded_port)
expect(n[2][1][:guest]).to eq(22)
expect(n[2][1][:host]).to eq(2222)
expect(n[2][1][:host_ip]).to eq("127.0.0.1")
expect(n[2][1][:id]).to eq("ssh")
end
it "allows overriding SSH" do
subject.network "forwarded_port",
guest: 22, host: 14100, id: "ssh"