core: Test eager loading of WinRM

This commit is contained in:
Mitchell Hashimoto 2014-04-09 11:41:24 -07:00
parent d608e0bdfd
commit c4a4b998df
2 changed files with 22 additions and 1 deletions

View File

@ -133,7 +133,7 @@ module Vagrant
# GH-3390
if @config.vm.communicator == :winrm
@logger.debug("Eager loading WinRM communicator to avoid GH-3390")
communiate
communicate
end
end

View File

@ -47,6 +47,27 @@ describe Vagrant::Machine do
end
describe "initialization" do
describe "communicator loading" do
it "doesn't eager load SSH" do
config.vm.communicator = :ssh
klass = Vagrant.plugin("2").manager.communicators[:ssh]
expect(klass).to_not receive(:new)
subject
end
it "eager loads WinRM" do
config.vm.communicator = :winrm
klass = Vagrant.plugin("2").manager.communicators[:winrm]
instance = double("instance")
expect(klass).to receive(:new).and_return(instance)
subject
end
end
describe "provider initialization" do
# This is a helper that generates a test for provider intialization.
# This is a separate helper method because it takes a block that can