Sha256: a504517f7e6a21d0651888e9615c8f83871e55f43d978b10bb133591a3490266

Contents?: true

Size: 805 Bytes

Versions: 8

Compression:

Stored size: 805 Bytes

Contents

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

describe "VagrantPlugins::GuestSUSE::Cap::Halt" do
  let(:caps) do
    VagrantPlugins::GuestSUSE::Plugin
      .components
      .guest_capabilities[:suse]
  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
    let(:cap) { caps.get(:halt) }

    it "runs the shutdown command" do
      comm.expect_command("/sbin/shutdown -h now")
      cap.halt(machine)
    end

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

Version data entries

8 entries across 8 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/suse/cap/halt_test.rb
vagrant-compose-yaml-0.1.2 vendor/bundle/ruby/2.2.0/bundler/gems/vagrant-dbb756c7b6da/test/unit/plugins/guests/suse/cap/halt_test.rb
vagrant-compose-yaml-0.1.1 vendor/bundle/ruby/2.2.0/bundler/gems/vagrant-dbb756c7b6da/test/unit/plugins/guests/suse/cap/halt_test.rb
vagrant-compose-yaml-0.1.0 vendor/bundle/ruby/2.2.0/bundler/gems/vagrant-dbb756c7b6da/test/unit/plugins/guests/suse/cap/halt_test.rb
vagrant-unbundled-1.8.5.2 test/unit/plugins/guests/suse/cap/halt_test.rb
vagrant-unbundled-1.8.5.1 test/unit/plugins/guests/suse/cap/halt_test.rb
vagrant-unbundled-1.8.4.2 test/unit/plugins/guests/suse/cap/halt_test.rb
vagrant-unbundled-1.8.4.1 test/unit/plugins/guests/suse/cap/halt_test.rb