vaguerent/test/vagrant/actions/vm/customize_test.rb
2010-06-03 20:32:09 -07:00

22 lines
607 B
Ruby

require File.join(File.dirname(__FILE__), '..', '..', '..', 'test_helper')
class CustomizeActionTest < Test::Unit::TestCase
setup do
@runner, @vm, @action = mock_action(Vagrant::Actions::VM::Customize)
end
context "executing" do
should "run the VM customization procs then save the VM" do
@runner.env.config.vm.customize { |vm| }
@runner.env.config.vm.expects(:run_procs!).with(@vm)
@vm.expects(:save).once
@action.execute!
end
should "not run anything if no customize blocks exist" do
@vm.expects(:save).never
@action.execute!
end
end
end