Provision registered actions

This commit is contained in:
Mitchell Hashimoto 2010-07-06 21:12:51 -07:00
parent 68f1e6c7e1
commit d313a106a3
3 changed files with 9 additions and 2 deletions

View File

@ -5,6 +5,13 @@ module Vagrant
# all the necessary Vagrant libraries are loaded. Hopefully
# in the future this will no longer be necessary with autoloading.
def self.builtin!
# provision - Provisions a running VM
provision = Builder.new do
use VM::Provision
end
register :provision, provision
# start - Starts a VM, assuming it already exists on the
# environment.
start = Builder.new do

View File

@ -118,7 +118,7 @@ module Vagrant
end
def provision
execute!(Actions::VM::Provision)
env.actions.run(:provision)
end
def destroy

View File

@ -184,7 +184,7 @@ class VMTest < Test::Unit::TestCase
context "provisioning" do
should "execute the provision action" do
@vm.expects(:execute!).with(Vagrant::Actions::VM::Provision).once
@vm.env.actions.expects(:run).with(:provision).once
@vm.provision
end
end