Provision registered actions
This commit is contained in:
parent
68f1e6c7e1
commit
d313a106a3
|
@ -5,6 +5,13 @@ module Vagrant
|
||||||
# all the necessary Vagrant libraries are loaded. Hopefully
|
# all the necessary Vagrant libraries are loaded. Hopefully
|
||||||
# in the future this will no longer be necessary with autoloading.
|
# in the future this will no longer be necessary with autoloading.
|
||||||
def self.builtin!
|
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
|
# start - Starts a VM, assuming it already exists on the
|
||||||
# environment.
|
# environment.
|
||||||
start = Builder.new do
|
start = Builder.new do
|
||||||
|
|
|
@ -118,7 +118,7 @@ module Vagrant
|
||||||
end
|
end
|
||||||
|
|
||||||
def provision
|
def provision
|
||||||
execute!(Actions::VM::Provision)
|
env.actions.run(:provision)
|
||||||
end
|
end
|
||||||
|
|
||||||
def destroy
|
def destroy
|
||||||
|
|
|
@ -184,7 +184,7 @@ class VMTest < Test::Unit::TestCase
|
||||||
|
|
||||||
context "provisioning" do
|
context "provisioning" do
|
||||||
should "execute the provision action" 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
|
@vm.provision
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue