Sha256: 379f748659302f7e3e6986d7d5c0fda3b7a2b2f2b6bf85e5383d20cf386778db

Contents?: true

Size: 929 Bytes

Versions: 59

Compression:

Stored size: 929 Bytes

Contents

require "test_helper"

class ModifyVMActionTest < Test::Unit::TestCase
  setup do
    @klass = Vagrant::Action::VM::Modify
    @app, @env = action_env

    @vm = mock("vm")
    @vm.stubs(:ssh).returns(mock("ssh"))
    @env["vm"] = @vm

    @internal_vm = mock("internal")
    @vm.stubs(:vm).returns(@internal_vm)

    @instance = @klass.new(@app, @env)
  end

  context "initialization" do
    should "have the vm.modify function setup in the environment" do
      assert @env.has_key?("vm.modify")
    end
  end

  context "calling" do
    should "run the procs with the VM as an argument and save the VM" do
      seq = sequence("procseq")

      proc = Proc.new { |vm| }
      @env["vm.modify"].call(proc)

      proc.expects(:call).with(@internal_vm).once.in_sequence(seq)
      @internal_vm.expects(:save).once.in_sequence(seq)
      @vm.expects(:reload!).once.in_sequence(seq)

      @instance.call(@env)
    end
  end
end

Version data entries

59 entries across 59 versions & 7 rubygems

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