From da27f248e7385c556afa3f50e85988a13a3c90ff Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Mon, 5 Jul 2010 19:44:47 +0200 Subject: [PATCH] VM#destroy and VM#up now use the new middleware stack --- lib/vagrant/action/builtin.rb | 4 ++-- lib/vagrant/vm.rb | 4 ++-- test/vagrant/vm_test.rb | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/vagrant/action/builtin.rb b/lib/vagrant/action/builtin.rb index f3ff83a8b..258da5812 100644 --- a/lib/vagrant/action/builtin.rb +++ b/lib/vagrant/action/builtin.rb @@ -18,14 +18,14 @@ module Vagrant use VM::Boot end - down = Builder.new do + destroy = Builder.new do use VM::Halt use VM::DestroyUnusedNetworkInterfaces use VM::Destroy end register :up, up - register :down, down + register :destroy, destroy end end end diff --git a/lib/vagrant/vm.rb b/lib/vagrant/vm.rb index 4ab57930b..aa50f17ff 100644 --- a/lib/vagrant/vm.rb +++ b/lib/vagrant/vm.rb @@ -100,7 +100,7 @@ module Vagrant end def up(options=nil) - execute!(Actions::VM::Up, options) + env.actions.run(:up, options) end def start @@ -122,7 +122,7 @@ module Vagrant end def destroy - execute!(Actions::VM::Down) + env.actions.run(:destroy) end def suspend diff --git a/test/vagrant/vm_test.rb b/test/vagrant/vm_test.rb index 5afcb9f8f..f6c65b008 100644 --- a/test/vagrant/vm_test.rb +++ b/test/vagrant/vm_test.rb @@ -163,7 +163,7 @@ class VMTest < Test::Unit::TestCase context "upping" do should "execute the up action" do - @vm.expects(:execute!).with(Vagrant::Actions::VM::Up, nil).once + @vm.env.actions.expects(:run).with(:up, nil).once @vm.up end end @@ -195,8 +195,8 @@ class VMTest < Test::Unit::TestCase end context "destroying" do - should "execute the down action" do - @vm.expects(:execute!).with(Vagrant::Actions::VM::Down).once + should "execute the destroy action" do + @vm.env.actions.expects(:run).with(:destroy).once @vm.destroy end end