diff --git a/lib/vagrant.rb b/lib/vagrant.rb index c26475201..1c2f38080 100644 --- a/lib/vagrant.rb +++ b/lib/vagrant.rb @@ -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 diff --git a/lib/vagrant/provisioners/base.rb b/lib/vagrant/provisioners/base.rb new file mode 100644 index 000000000..26394086c --- /dev/null +++ b/lib/vagrant/provisioners/base.rb @@ -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 \ No newline at end of file diff --git a/test/vagrant/provisioners/base_test.rb b/test/vagrant/provisioners/base_test.rb new file mode 100644 index 000000000..6473fcf77 --- /dev/null +++ b/test/vagrant/provisioners/base_test.rb @@ -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