Sha256: 745c71c5665fc83adad4be2a8658807af58f803fd68390d47e36796427347294

Contents?: true

Size: 953 Bytes

Versions: 1

Compression:

Stored size: 953 Bytes

Contents

require File.expand_path("../../../../../base", __FILE__)

require Vagrant.source_root.join("plugins/guests/windows/cap/halt")

describe "VagrantPlugins::GuestWindows::Cap::Halt" do
  let(:described_class) do
    VagrantPlugins::GuestWindows::Plugin.components.guest_capabilities[:windows].get(:halt)
  end
  let(:machine) { double("machine") }
  let(:communicator) { VagrantTests::DummyCommunicator::Communicator.new(machine) }

  before do
    allow(machine).to receive(:communicate).and_return(communicator)
  end

  after do
    communicator.verify_expectations!
  end

  describe ".halt" do
  
    it "cancels any existing scheduled shut down" do
      communicator.expect_command("shutdown -a")
      described_class.halt(machine)
    end

    it "shuts down immediately" do
      communicator.expect_command('shutdown /s /t 1 /c "Vagrant Halt" /f /d p:4:1')
      described_class.halt(machine)
    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
vagrant-cloudstack-1.2.0 vendor/bundle/bundler/gems/vagrant-c84e05fd063f/test/unit/plugins/guests/windows/cap/halt_test.rb