Sha256: 76deff870311c30aef4c56df2c500d21a7418206faa4d81e76e4f45ece1c1b0d

Contents?: true

Size: 1.05 KB

Versions: 10

Compression:

Stored size: 1.05 KB

Contents

require File.join(File.dirname(__FILE__), '..', '..', '..', 'test_helper')

class StartActionTest < Test::Unit::TestCase
  setup do
    @mock_vm, @vm, @action = mock_action(Vagrant::Actions::VM::Start)
  end

  context "sub-actions" do
    setup do
      @vm.stubs(:saved?).returns(true)
      File.stubs(:file?).returns(true)
      File.stubs(:exist?).returns(true)
      @default_order = [Vagrant::Actions::VM::Boot]
    end

    def setup_action_expectations
      default_seq = sequence("default_seq")
      @default_order.flatten.each do |action|
        @mock_vm.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 "add customize to the beginning if its not saved" do
      @vm.expects(:saved?).returns(false)
      @default_order.unshift([Vagrant::Actions::VM::Customize, Vagrant::Actions::VM::ForwardPorts, Vagrant::Actions::VM::SharedFolders])
      setup_action_expectations
      @action.prepare
    end
  end
end

Version data entries

10 entries across 10 versions & 2 rubygems

Version Path
vagrantup-0.3.4 test/vagrant/actions/vm/start_test.rb
vagrantup-0.3.3 test/vagrant/actions/vm/start_test.rb
vagrantup-0.3.2 test/vagrant/actions/vm/start_test.rb
vagrantup-0.3.1 test/vagrant/actions/vm/start_test.rb
vagrantup-0.3.0 test/vagrant/actions/vm/start_test.rb
vagrant-0.3.4 test/vagrant/actions/vm/start_test.rb
vagrant-0.3.3 test/vagrant/actions/vm/start_test.rb
vagrant-0.3.2 test/vagrant/actions/vm/start_test.rb
vagrant-0.3.1 test/vagrant/actions/vm/start_test.rb
vagrant-0.3.0 test/vagrant/actions/vm/start_test.rb