`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
|
# This command requires that an instance already be brought up with
|
||||||
# `vagrant up`.
|
# `vagrant up`.
|
||||||
def ssh
|
def ssh
|
||||||
Env.load!
|
env = Environment.load!
|
||||||
Env.require_persisted_vm
|
env.require_persisted_vm
|
||||||
SSH.connect
|
env.ssh.connect
|
||||||
end
|
end
|
||||||
|
|
||||||
# Halts a running vagrant instance. This forcibly halts the instance;
|
# Halts a running vagrant instance. This forcibly halts the instance;
|
||||||
|
|
|
@ -120,16 +120,21 @@ class CommandsTest < Test::Unit::TestCase
|
||||||
|
|
||||||
context "ssh" do
|
context "ssh" do
|
||||||
setup 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
|
end
|
||||||
|
|
||||||
should "require a persisted VM" do
|
should "require a persisted VM" do
|
||||||
Vagrant::Env.expects(:require_persisted_vm).once
|
@env.expects(:require_persisted_vm).once
|
||||||
Vagrant::Commands.ssh
|
Vagrant::Commands.ssh
|
||||||
end
|
end
|
||||||
|
|
||||||
should "connect to SSH" do
|
should "connect to SSH" do
|
||||||
Vagrant::SSH.expects(:connect).once
|
@env.ssh.expects(:connect).once
|
||||||
Vagrant::Commands.ssh
|
Vagrant::Commands.ssh
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue