Get unit tests passing again
This commit is contained in:
parent
8bb6d375f1
commit
1155983307
|
@ -9,6 +9,7 @@ class SshTest < Test::Unit::TestCase
|
||||||
@env.vm.stubs(:vm).returns(@vm)
|
@env.vm.stubs(:vm).returns(@vm)
|
||||||
|
|
||||||
@ssh = Vagrant::SSH.new(@env)
|
@ssh = Vagrant::SSH.new(@env)
|
||||||
|
@session = mock("session")
|
||||||
end
|
end
|
||||||
|
|
||||||
setup do
|
setup do
|
||||||
|
@ -177,11 +178,7 @@ class SshTest < Test::Unit::TestCase
|
||||||
mock_ssh
|
mock_ssh
|
||||||
@ssh.stubs(:check_key_permissions)
|
@ssh.stubs(:check_key_permissions)
|
||||||
@ssh.stubs(:port).returns(2222)
|
@ssh.stubs(:port).returns(2222)
|
||||||
end
|
@session.stubs(:exec!).returns("hello\n")
|
||||||
|
|
||||||
should "return true if SSH connection works" do
|
|
||||||
Net::SSH.expects(:start).yields("success")
|
|
||||||
assert @ssh.up?
|
|
||||||
end
|
end
|
||||||
|
|
||||||
should "return false if SSH connection times out" do
|
should "return false if SSH connection times out" do
|
||||||
|
@ -203,8 +200,8 @@ class SshTest < Test::Unit::TestCase
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
should "specifity the timeout as an option to execute" do
|
should "specify the timeout as an option to execute" do
|
||||||
@ssh.expects(:execute).yields(true).with() do |opts|
|
@ssh.expects(:execute).yields(@session).with() do |opts|
|
||||||
assert_equal @env.config.ssh.timeout, opts[:timeout]
|
assert_equal @env.config.ssh.timeout, opts[:timeout]
|
||||||
true
|
true
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue