Sha256: 6dba9b93ee616b52390262a4fe41f09d2842d47f5c4cd76b91c0793f04823bd2

Contents?: true

Size: 826 Bytes

Versions: 6

Compression:

Stored size: 826 Bytes

Contents

require_relative "../../../../base"

describe "VagrantPlugins::GuestFreeBSD::Cap::Halt" do
  let(:described_class) do
    VagrantPlugins::GuestFreeBSD::Plugin
      .components
      .guest_capabilities[:freebsd]
      .get(:halt)
  end

  let(:machine) { double("machine") }
  let(:comm) { VagrantTests::DummyCommunicator::Communicator.new(machine) }

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

  after do
    comm.verify_expectations!
  end

  describe ".halt" do
    it "runs the shutdown command" do
      comm.expect_command("shutdown -p now")
      described_class.halt(machine)
    end

    it "does not raise an IOError" do
      comm.stub_command("shutdown -p now", raise: IOError)
      expect {
        described_class.halt(machine)
      }.to_not raise_error
    end
  end
end

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
vagrant-compose-yaml-0.1.3 vendor/bundle/ruby/2.2.0/bundler/gems/vagrant-dbb756c7b6da/test/unit/plugins/guests/freebsd/cap/halt_test.rb
vagrant-compose-yaml-0.1.2 vendor/bundle/ruby/2.2.0/bundler/gems/vagrant-dbb756c7b6da/test/unit/plugins/guests/freebsd/cap/halt_test.rb
vagrant-compose-yaml-0.1.1 vendor/bundle/ruby/2.2.0/bundler/gems/vagrant-dbb756c7b6da/test/unit/plugins/guests/freebsd/cap/halt_test.rb
vagrant-compose-yaml-0.1.0 vendor/bundle/ruby/2.2.0/bundler/gems/vagrant-dbb756c7b6da/test/unit/plugins/guests/freebsd/cap/halt_test.rb
vagrant-unbundled-1.8.4.2 test/unit/plugins/guests/freebsd/cap/halt_test.rb
vagrant-unbundled-1.8.4.1 test/unit/plugins/guests/freebsd/cap/halt_test.rb