Skip to content

Commit 09f24d1

Browse files
author
Marno van der Molen
committed
Updates unit test to add communicator field to vm_config in spec_helper.rb and fixes if defined check
1 parent 338bd6d commit 09f24d1

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/vSphere/util/machine_helpers.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module VSphere
33
module Util
44
module MachineHelpers
55
def wait_for_ssh(env)
6-
if defined?env[:machine].config.vm.communicator and env[:machine].config.vm.communicator == :winrm
6+
if not env[:machine].config.vm.communicator.nil? and env[:machine].config.vm.communicator == :winrm
77
env[:ui].info(I18n.t("vsphere.waiting_for_winrm"))
88
else
99
env[:ui].info(I18n.t("vsphere.waiting_for_ssh"))

spec/spec_helper.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def call
4545
:proxy_host => nil,
4646
:proxy_port => nil)
4747
vm_config = double(
48-
:vm => double('config_vm', :synced_folders => [], :provisioners => [], :networks => [[:private_network, {:ip => '0.0.0.0'}]]),
48+
:vm => double('config_vm', :synced_folders => [], :provisioners => [], :communicator => nil, :networks => [[:private_network, {:ip => '0.0.0.0'}]]),
4949
:validate => []
5050
)
5151
@app = double 'app', :call => true

0 commit comments

Comments
 (0)