diff --git a/lib/vagrant.rb b/lib/vagrant.rb index 6eae2302a..a4e2456d1 100644 --- a/lib/vagrant.rb +++ b/lib/vagrant.rb @@ -19,3 +19,4 @@ require 'vagrant/env' require 'vagrant/provisioning' require 'vagrant/ssh' require 'vagrant/vm' +require 'vagrant/actions/base' \ No newline at end of file diff --git a/test/vagrant/actions/base_test.rb b/test/vagrant/actions/base_test.rb new file mode 100644 index 000000000..996bc3e09 --- /dev/null +++ b/test/vagrant/actions/base_test.rb @@ -0,0 +1,32 @@ +require File.join(File.dirname(__FILE__), '..', '..', 'test_helper') + +class BaseActionTest < Test::Unit::TestCase + should "include the util class so subclasses have access to it" do + assert Vagrant::Actions::Base.include?(Vagrant::Util) + end + + context "base instance" do + setup do + @mock_vm = mock("vm") + @base = Vagrant::Actions::Base.new(@mock_vm) + end + + should "allow read-only access to the VM" do + assert_equal @mock_vm, @base.vm + end + + should "implement prepare which does nothing" do + assert_nothing_raised do + assert @base.respond_to?(:prepare) + @base.prepare + end + end + + should "implement the execute! method which does nothing" do + assert_nothing_raised do + assert @base.respond_to?(:execute!) + @base.execute! + end + end + end +end