`vagrant suspend` update to work with new environment
This commit is contained in:
parent
e68994556c
commit
c7508e91b9
|
@ -137,9 +137,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 suspend
|
def suspend
|
||||||
Env.load!
|
env = Environment.load!
|
||||||
Env.require_persisted_vm
|
env.require_persisted_vm
|
||||||
Env.persisted_vm.suspend
|
env.vm.suspend
|
||||||
end
|
end
|
||||||
|
|
||||||
# Resume a running vagrant instance. This resumes an already suspended
|
# Resume a running vagrant instance. This resumes an already suspended
|
||||||
|
|
|
@ -167,8 +167,13 @@ class CommandsTest < Test::Unit::TestCase
|
||||||
@persisted_vm.stubs(:saved?).returns(false)
|
@persisted_vm.stubs(:saved?).returns(false)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
should "load the current environment" do
|
||||||
|
Vagrant::Environment.expects(:load!).once.returns(@env)
|
||||||
|
Vagrant::Commands.suspend
|
||||||
|
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.suspend
|
Vagrant::Commands.suspend
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue