diff --git a/lib/vagrant/machine.rb b/lib/vagrant/machine.rb index 53e48050f..11c487f48 100644 --- a/lib/vagrant/machine.rb +++ b/lib/vagrant/machine.rb @@ -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 diff --git a/test/unit/vagrant/machine_test.rb b/test/unit/vagrant/machine_test.rb index 784f205fa..ded42ffc7 100644 --- a/test/unit/vagrant/machine_test.rb +++ b/test/unit/vagrant/machine_test.rb @@ -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