`vagrant ssh` with new Environment
This commit is contained in:
parent
62de77132c
commit
259a3a3836
|
@ -113,9 +113,9 @@ msg
|
|||
# This command requires that an instance already be brought up with
|
||||
# `vagrant up`.
|
||||
def ssh
|
||||
Env.load!
|
||||
Env.require_persisted_vm
|
||||
SSH.connect
|
||||
env = Environment.load!
|
||||
env.require_persisted_vm
|
||||
env.ssh.connect
|
||||
end
|
||||
|
||||
# Halts a running vagrant instance. This forcibly halts the instance;
|
||||
|
|
|
@ -120,16 +120,21 @@ class CommandsTest < Test::Unit::TestCase
|
|||
|
||||
context "ssh" do
|
||||
setup do
|
||||
Vagrant::SSH.stubs(:connect)
|
||||
@env.ssh.stubs(:connect)
|
||||
end
|
||||
|
||||
should "load the current environment" do
|
||||
Vagrant::Environment.expects(:load!).once.returns(@env)
|
||||
Vagrant::Commands.ssh
|
||||
end
|
||||
|
||||
should "require a persisted VM" do
|
||||
Vagrant::Env.expects(:require_persisted_vm).once
|
||||
@env.expects(:require_persisted_vm).once
|
||||
Vagrant::Commands.ssh
|
||||
end
|
||||
|
||||
should "connect to SSH" do
|
||||
Vagrant::SSH.expects(:connect).once
|
||||
@env.ssh.expects(:connect).once
|
||||
Vagrant::Commands.ssh
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue