VM#destroy and VM#up now use the new middleware stack
This commit is contained in:
parent
cfc87d4ce3
commit
da27f248e7
|
@ -18,14 +18,14 @@ module Vagrant
|
||||||
use VM::Boot
|
use VM::Boot
|
||||||
end
|
end
|
||||||
|
|
||||||
down = Builder.new do
|
destroy = Builder.new do
|
||||||
use VM::Halt
|
use VM::Halt
|
||||||
use VM::DestroyUnusedNetworkInterfaces
|
use VM::DestroyUnusedNetworkInterfaces
|
||||||
use VM::Destroy
|
use VM::Destroy
|
||||||
end
|
end
|
||||||
|
|
||||||
register :up, up
|
register :up, up
|
||||||
register :down, down
|
register :destroy, destroy
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -100,7 +100,7 @@ module Vagrant
|
||||||
end
|
end
|
||||||
|
|
||||||
def up(options=nil)
|
def up(options=nil)
|
||||||
execute!(Actions::VM::Up, options)
|
env.actions.run(:up, options)
|
||||||
end
|
end
|
||||||
|
|
||||||
def start
|
def start
|
||||||
|
@ -122,7 +122,7 @@ module Vagrant
|
||||||
end
|
end
|
||||||
|
|
||||||
def destroy
|
def destroy
|
||||||
execute!(Actions::VM::Down)
|
env.actions.run(:destroy)
|
||||||
end
|
end
|
||||||
|
|
||||||
def suspend
|
def suspend
|
||||||
|
|
|
@ -163,7 +163,7 @@ class VMTest < Test::Unit::TestCase
|
||||||
|
|
||||||
context "upping" do
|
context "upping" do
|
||||||
should "execute the up action" 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
|
@vm.up
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -195,8 +195,8 @@ class VMTest < Test::Unit::TestCase
|
||||||
end
|
end
|
||||||
|
|
||||||
context "destroying" do
|
context "destroying" do
|
||||||
should "execute the down action" do
|
should "execute the destroy action" do
|
||||||
@vm.expects(:execute!).with(Vagrant::Actions::VM::Down).once
|
@vm.env.actions.expects(:run).with(:destroy).once
|
||||||
@vm.destroy
|
@vm.destroy
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue