Sha256: c5f6a772abc5efc2e0b1b96b1955516461de927e807a96501a2e24f7a86096c8

Contents?: true

Size: 1.16 KB

Versions: 40

Compression:

Stored size: 1.16 KB

Contents

require "test_helper"

class ConfigVMTest < Test::Unit::TestCase
  setup do
    @username = "mitchellh"

    @env = vagrant_env
    @config = @env.config.vm
    @env.config.ssh.username = @username
  end

  context "defining VMs" do
    should "store the proc by name but not run it" do
      foo = mock("proc")
      foo.expects(:call).never

      proc = Proc.new { foo.call }
      @config.define(:name, &proc)
      assert @config.defined_vms[:name].proc_stack.include?(proc)
    end

    should "store the options" do
      @config.define(:name, :set => true)
      assert @config.defined_vms[:name].options[:set]
    end

    should "retain vm definition order" do
      @config.define(:a) {}
      @config.define(:b) {}
      @config.define(:c) {}

      assert_equal [:a, :b, :c], @config.defined_vm_keys
    end
  end

  context "customizing" do
    should "include the stacked proc runner module" do
      assert @config.class.included_modules.include?(Vagrant::Util::StackedProcRunner)
    end

    should "add the customize proc to the proc stack" do
      proc = Proc.new {}
      @config.customize(&proc)
      assert @config.proc_stack.include?(proc)
    end
  end
end

Version data entries

40 entries across 40 versions & 6 rubygems

Version Path
bmhatfield-vagrant-1.0.10 test/unit_legacy/vagrant/config/vm_test.rb
bmhatfield-vagrant-1.0.9 test/unit_legacy/vagrant/config/vm_test.rb
bmhatfield-vagrant-1.0.8 test/unit_legacy/vagrant/config/vm_test.rb
bmhatfield-vagrant-1.0.7 test/unit_legacy/vagrant/config/vm_test.rb
vagrantup-1.0.7 test/unit_legacy/vagrant/config/vm_test.rb
vagrantup-1.0.6 test/unit_legacy/vagrant/config/vm_test.rb
vagrantup-1.0.5 test/unit_legacy/vagrant/config/vm_test.rb
vagrantup-1.0.4 test/unit_legacy/vagrant/config/vm_test.rb
vagrantup-1.0.3 test/unit_legacy/vagrant/config/vm_test.rb
vagrantup-1.0.2 test/unit_legacy/vagrant/config/vm_test.rb
vagrantup-1.0.1 test/unit_legacy/vagrant/config/vm_test.rb
vagrantup-1.0.0 test/unit_legacy/vagrant/config/vm_test.rb
vagrantup-0.9.99.2 test/unit_legacy/vagrant/config/vm_test.rb
vagrantup-0.9.99.1 test/unit_legacy/vagrant/config/vm_test.rb
vagrantup-0.9.7 test/unit_legacy/vagrant/config/vm_test.rb
vagrantup-0.9.6 test/unit_legacy/vagrant/config/vm_test.rb
vagrantup-0.9.5 test/unit_legacy/vagrant/config/vm_test.rb
vagrantup-0.9.4 test/unit_legacy/vagrant/config/vm_test.rb
vagrantup-0.9.3 test/unit_legacy/vagrant/config/vm_test.rb
vagrantup-0.9.2 test/unit_legacy/vagrant/config/vm_test.rb