`vagrant halt` uses new environment
This commit is contained in:
parent
259a3a3836
commit
b461e0ee8b
|
@ -125,9 +125,9 @@ msg
|
||||||
# This command requires than an instance already be brought up with
|
# This command requires than an instance already be brought up with
|
||||||
# `vagrant up`.
|
# `vagrant up`.
|
||||||
def halt
|
def halt
|
||||||
Env.load!
|
env = Environment.load!
|
||||||
Env.require_persisted_vm
|
env.require_persisted_vm
|
||||||
Env.persisted_vm.execute!(Actions::VM::Halt)
|
env.vm.execute!(Actions::VM::Halt)
|
||||||
end
|
end
|
||||||
|
|
||||||
# Suspend a running vagrant instance. This suspends the instance, saving
|
# Suspend a running vagrant instance. This suspends the instance, saving
|
||||||
|
|
|
@ -140,8 +140,13 @@ class CommandsTest < Test::Unit::TestCase
|
||||||
end
|
end
|
||||||
|
|
||||||
context "halt" do
|
context "halt" do
|
||||||
|
should "load the current environment" do
|
||||||
|
Vagrant::Environment.expects(:load!).once.returns(@env)
|
||||||
|
Vagrant::Commands.halt
|
||||||
|
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.halt
|
Vagrant::Commands.halt
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue