Sha256: afadf0cc3dab870cd242fec023553468b5599fa43f522e4836c9e1d082415c4b

Contents?: true

Size: 920 Bytes

Versions: 7

Compression:

Stored size: 920 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

7 entries across 4 versions & 3 rubygems

Version Path
vagrant-unbundled-1.8.1.2 test/unit/plugins/guests/windows/cap/halt_test.rb
vagrant-unbundled-1.8.1.1 test/unit/plugins/guests/windows/cap/halt_test.rb
vagrant-cloudstack-1.1.0 vendor/bundle/bundler/gems/vagrant-272fb27e0536/test/unit/plugins/guests/windows/cap/halt_test.rb
vagrant-cloudstack-1.1.0 vendor/bundle/bundler/gems/vagrant-b421af58e8b3/test/unit/plugins/guests/windows/cap/halt_test.rb
vagrant-cloudstack-1.1.0 vendor/bundle/bundler/gems/vagrant-309e896975d1/test/unit/plugins/guests/windows/cap/halt_test.rb
vagrant-cloudstack-1.1.0 vendor/bundle/bundler/gems/vagrant-1cf2a8db4ccb/test/unit/plugins/guests/windows/cap/halt_test.rb
vagrant-tiktalik-0.0.3 vendor/bundle/ruby/2.0.0/bundler/gems/vagrant-1e28f1ac31e7/test/unit/plugins/guests/windows/cap/halt_test.rb