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
|
||||
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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue