Sha256: 38e47ec5ac553977dc0c6690182f1dc1cb4d567050c7781c915dfc0a1b708be5
Contents?: true
Size: 1.14 KB
Versions: 11
Compression:
Stored size: 1.14 KB
Contents
require_relative "../../../../base" describe "VagrantPlugins::GuestSolaris11::Cap::Halt" do let(:caps) do VagrantPlugins::GuestSolaris11::Plugin .components .guest_capabilities[:solaris11] end let(:shutdown_command){ "sudo /usr/sbin/shutdown -y -i5 -g0" } let(:machine) { double("machine", config: double("config", solaris11: double("solaris11", suexec_cmd: 'sudo'))) } 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
11 entries across 11 versions & 2 rubygems