From 0641df7563f243868d0f14a600e1ce7208f6e998 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Fri, 19 Mar 2010 16:53:18 -0700 Subject: [PATCH] `vagrant resume` command now uses new environment --- lib/vagrant/commands.rb | 6 +++--- test/vagrant/commands_test.rb | 7 ++++++- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/lib/vagrant/commands.rb b/lib/vagrant/commands.rb index 523cfec93..a75fc0bad 100644 --- a/lib/vagrant/commands.rb +++ b/lib/vagrant/commands.rb @@ -148,9 +148,9 @@ msg # This command requires that an instance already be brought up with # `vagrant up`. def resume - Env.load! - Env.require_persisted_vm - Env.persisted_vm.resume + env = Environment.load! + env.require_persisted_vm + env.vm.resume end # Export and package the current vm diff --git a/test/vagrant/commands_test.rb b/test/vagrant/commands_test.rb index ea0807c0b..beba216b4 100644 --- a/test/vagrant/commands_test.rb +++ b/test/vagrant/commands_test.rb @@ -189,8 +189,13 @@ class CommandsTest < Test::Unit::TestCase @persisted_vm.stubs(:saved?).returns(true) end + should "load the current environment" do + Vagrant::Environment.expects(:load!).once.returns(@env) + Vagrant::Commands.resume + end + should "require a persisted VM" do - Vagrant::Env.expects(:require_persisted_vm).once + @env.expects(:require_persisted_vm).once Vagrant::Commands.resume end