Sha256: 013060016c8cf8b2bf38df23da657213470742ce2d2dadb607d2e4caee2caa34
Contents?: true
Size: 869 Bytes
Versions: 101
Compression:
Stored size: 869 Bytes
Contents
require "test_helper" class SuspendVMActionTest < Test::Unit::TestCase setup do @klass = Vagrant::Action::VM::Suspend @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 running" do @internal_vm.expects(:running?).returns(true) seq = sequence("seq") @internal_vm.expects(:save_state).once.in_sequence(seq) @app.expects(:call).with(@env).once.in_sequence(seq) @instance.call(@env) end should "do nothing if VM is not running" do @internal_vm.expects(:running?).returns(false) @internal_vm.expects(:save_state).never @app.expects(:call).with(@env).once @instance.call(@env) end end end
Version data entries
101 entries across 101 versions & 9 rubygems