add expect for warn message

This commit is contained in:
Facundo Guerrero 2014-03-27 15:25:12 -03:00
parent 697d8bde08
commit 36b38b7664

View file

@ -33,6 +33,7 @@ describe Vagrant::LXC::Action::ForwardPorts do
it 'forwards ports using redir' do it 'forwards ports using redir' do
subject.stub(system: true) subject.stub(system: true)
subject.call(env) subject.call(env)
expect(env).to have_received(:warn)
expect(subject).to have_received(:spawn).with( expect(subject).to have_received(:spawn).with(
"sudo redir --laddr=#{host_ip} --lport=#{host_port} --caddr=#{container_ip} --cport=#{guest_port} 2>/dev/null" "sudo redir --laddr=#{host_ip} --lport=#{host_port} --caddr=#{container_ip} --cport=#{guest_port} 2>/dev/null"
) )
@ -42,6 +43,7 @@ describe Vagrant::LXC::Action::ForwardPorts do
forward_conf.delete(:host_ip) forward_conf.delete(:host_ip)
subject.stub(system: true) subject.stub(system: true)
subject.call(env) subject.call(env)
expect(env).to have_received(:warn)
expect(subject).to have_received(:spawn).with( expect(subject).to have_received(:spawn).with(
"sudo redir --lport=#{host_port} --caddr=#{container_ip} --cport=#{guest_port} 2>/dev/null" "sudo redir --lport=#{host_port} --caddr=#{container_ip} --cport=#{guest_port} 2>/dev/null"
) )
@ -51,6 +53,7 @@ describe Vagrant::LXC::Action::ForwardPorts do
forward_conf[:host_ip] = ' ' forward_conf[:host_ip] = ' '
subject.stub(system: true) subject.stub(system: true)
subject.call(env) subject.call(env)
expect(env).to have_received(:warn)
expect(subject).to have_received(:spawn).with( expect(subject).to have_received(:spawn).with(
"sudo redir --lport=#{host_port} --caddr=#{container_ip} --cport=#{guest_port} 2>/dev/null" "sudo redir --lport=#{host_port} --caddr=#{container_ip} --cport=#{guest_port} 2>/dev/null"
) )