Sha256: 5f8aaedf8f9358c07df38944a4f27ccea7ae42b7ddb8a3f431f970db489dfd1d
Contents?: true
Size: 1.03 KB
Versions: 24
Compression:
Stored size: 1.03 KB
Contents
require_relative "../../../../base" describe "VagrantPlugins::GuestEsxi::Cap::Halt" do let(:caps) do VagrantPlugins::GuestEsxi::Plugin .components .guest_capabilities[:esxi] end let(:shutdown_command){ "/bin/halt -d 0" } 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 let(:cap) { caps.get(:halt) } it "runs the shutdown command" do comm.expect_command(shutdown_command) cap.halt(machine) end it "ignores an IOError" do comm.stub_command(shutdown_command, raise: IOError) expect { cap.halt(machine) }.to_not raise_error end it "ignores a Vagrant::Errors::SSHDisconnected" do comm.stub_command(shutdown_command, raise: Vagrant::Errors::SSHDisconnected) expect { cap.halt(machine) }.to_not raise_error end end end
Version data entries
24 entries across 20 versions & 5 rubygems