Base provisioning class

This commit is contained in:
Mitchell Hashimoto 2010-03-10 12:56:52 -08:00
parent 6cfddb6c38
commit f86bc912eb
3 changed files with 38 additions and 1 deletions

View File

@ -4,7 +4,8 @@ PROJECT_ROOT = File.join(libdir, '..') unless defined?(PROJECT_ROOT)
# The libs which must be loaded prior to the rest
%w{tempfile open-uri json pathname logger uri net/http virtualbox net/ssh archive/tar/minitar
net/scp fileutils vagrant/util vagrant/actions/base vagrant/downloaders/base vagrant/actions/runner}.each do |f|
net/scp fileutils vagrant/util vagrant/actions/base vagrant/downloaders/base vagrant/actions/runner
vagrant/provisioners/base}.each do |f|
require f
end

View File

@ -0,0 +1,16 @@
module Vagrant
module Provisioners
# The base class for a "provisioner." A provisioner is responsible for
# provisioning a Vagrant system. This has been abstracted out to provide
# support for multiple solutions such as Chef Solo, Chef Client, and
# Puppet.
class Base
include Vagrant::Util
# This is the single method called to provision the system. This method
# is expected to do whatever necessary to provision the system (create files,
# SSH, etc.)
def provision!; end
end
end
end

View File

@ -0,0 +1,20 @@
require File.join(File.dirname(__FILE__), '..', '..', 'test_helper')
class BaseProvisionerTest < Test::Unit::TestCase
should "include the util class so subclasses have access to it" do
assert Vagrant::Provisioners::Base.include?(Vagrant::Util)
end
context "base instance" do
setup do
@base = Vagrant::Provisioners::Base.new
end
should "implement provision! which does nothing" do
assert_nothing_raised do
assert @base.respond_to?(:provision!)
@base.provision!
end
end
end
end