Added test to verify Windows symlinks to shares are fixed

This commit is contained in:
Shawn Neal 2014-04-30 17:35:26 -07:00
parent 068b5cf0b9
commit 309f301a16
1 changed files with 11 additions and 11 deletions

View File

@ -9,7 +9,7 @@ describe "VagrantPlugins::GuestWindows::Cap::Reboot" do
let(:vm) { double("vm") }
let(:config) { double("config") }
let(:machine) { double("machine") }
let(:communicator) { double(:execute) }
let(:communicator) { double("communicator") }
before do
allow(machine).to receive(:communicate).and_return(communicator)
@ -18,37 +18,37 @@ describe "VagrantPlugins::GuestWindows::Cap::Reboot" do
end
describe "winrm communicator" do
before do
allow(vm).to receive(:communicator).and_return(:winrm)
end
describe ".wait_for_reboot" do
it "runs reboot detect script" do
expect(communicator).to receive(:execute) do |cmd|
expect(cmd).to include("SM_SHUTTINGDOWN")
end.and_return(0)
expect(communicator).to receive(:execute).with(/# Function/, { error_check: false }).and_return(0)
allow(communicator).to receive(:execute)
described_class.wait_for_reboot(machine)
end
it "fixes symlinks to network shares" do
allow(communicator).to receive(:execute).and_return(0)
expect(communicator).to receive(:execute).with('net use', { error_check: false })
described_class.wait_for_reboot(machine)
end
end
end
describe "ssh communicator" do
before do
allow(vm).to receive(:communicator).and_return(:ssh)
end
describe ".wait_for_reboot" do
it "runs reboot detect script" do
it "does not execute Windows reboot detect script" do
expect(communicator).to_not receive(:execute)
described_class.wait_for_reboot(machine)
end
end
end
end