Sha256: e54cff9f1920cc915497ab3e8be0d1eaae90289d287a3c937597587710f1f246
Contents?: true
Size: 1.34 KB
Versions: 6
Compression:
Stored size: 1.34 KB
Contents
require File.join(File.dirname(__FILE__), '..', '..', '..', 'test_helper') class ReloadActionTest < Test::Unit::TestCase setup do @runner, @vm, @action = mock_action(Vagrant::Actions::VM::Reload) end context "sub-actions" do setup do @default_order = [Vagrant::Actions::VM::Customize, Vagrant::Actions::VM::ForwardPorts, Vagrant::Actions::VM::SharedFolders, Vagrant::Actions::VM::Network, Vagrant::Actions::VM::Boot] @vm.stubs(:running?).returns(false) end def setup_action_expectations default_seq = sequence("default_seq") @default_order.each do |action| @runner.expects(:add_action).with(action).once.in_sequence(default_seq) end end should "do the proper actions by default" do setup_action_expectations @action.prepare end should "halt if the VM is running" do @vm.expects(:running?).returns(true) @default_order.unshift(Vagrant::Actions::VM::Halt) setup_action_expectations @action.prepare end should "add in the provisioning step if enabled" do env = mock_environment do |config| # Dummy provisioner to test config.vm.provisioner = "foo" end @runner.stubs(:env).returns(env) @default_order.push(Vagrant::Actions::VM::Provision) setup_action_expectations @action.prepare end end end
Version data entries
6 entries across 6 versions & 2 rubygems