Sha256: fded49b694bc1f06eefa5c86209a7eeb00cd6046ee4c9b05a4f211691ccef152

Contents?: true

Size: 874 Bytes

Versions: 101

Compression:

Stored size: 874 Bytes

Contents

require "test_helper"

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

    @vm = mock("vm")
    @env["vm"] = @vm

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

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

  context "calling" do
    should "run the proper methods when saved" do
      @internal_vm.expects(:saved?).returns(true)

      seq = sequence("seq")
      @env.env.actions.expects(:run).with(Vagrant::Action::VM::Boot).once.in_sequence(seq)
      @app.expects(:call).with(@env).once.in_sequence(seq)
      @instance.call(@env)
    end

    should "do nothing if VM is not saved" do
      @internal_vm.expects(:saved?).returns(false)

      @vm.expects(:start).never
      @app.expects(:call).with(@env).once
      @instance.call(@env)
    end
  end
end

Version data entries

101 entries across 101 versions & 9 rubygems

Version Path
vagrantup-0.9.1 test/unit_legacy/vagrant/action/vm/resume_test.rb
vagrantup-0.9.0 test/unit_legacy/vagrant/action/vm/resume_test.rb
vagrantup-0.8.9 test/unit/vagrant/action/vm/resume_test.rb
vagrantup-0.8.8 test/unit/vagrant/action/vm/resume_test.rb
vagrantup-0.8.7 test/unit/vagrant/action/vm/resume_test.rb
vagrantup-0.8.6 test/vagrant/action/vm/resume_test.rb
vagrantup-0.8.5 test/vagrant/action/vm/resume_test.rb
vagrantup-0.8.4 test/vagrant/action/vm/resume_test.rb
vagrantup-0.8.3 test/vagrant/action/vm/resume_test.rb
vagrantup-0.8.2 test/vagrant/action/vm/resume_test.rb
vagrantup-0.8.10 test/unit/vagrant/action/vm/resume_test.rb
vagrantup-0.8.1 test/vagrant/action/vm/resume_test.rb
vagrantup-0.8.0 test/vagrant/action/vm/resume_test.rb
vagrantup-0.7.8 test/vagrant/action/vm/resume_test.rb
vagrantup-0.7.7 test/vagrant/action/vm/resume_test.rb
vagrantup-0.7.6 test/vagrant/action/vm/resume_test.rb
vagrantup-0.7.5 test/vagrant/action/vm/resume_test.rb
vagrantup-0.7.4 test/vagrant/action/vm/resume_test.rb
vagrantup-0.7.3 test/vagrant/action/vm/resume_test.rb
vagrantup-0.7.2 test/vagrant/action/vm/resume_test.rb