Base action tests

This commit is contained in:
Mitchell Hashimoto 2010-02-13 11:38:11 -08:00
parent 4ea450ba2a
commit d9986034b3
2 changed files with 33 additions and 0 deletions

View File

@ -19,3 +19,4 @@ require 'vagrant/env'
require 'vagrant/provisioning'
require 'vagrant/ssh'
require 'vagrant/vm'
require 'vagrant/actions/base'

View File

@ -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