Sha256: f6dc4e8500e07a404b75ab1614b27c387462d1fcc357ff44e8e1eda7020b54c4

Contents?: true

Size: 1.23 KB

Versions: 59

Compression:

Stored size: 1.23 KB

Contents

require File.expand_path("../base", __FILE__)
require "acceptance/support/shared/command_examples"

describe "vagrant destroy" do
  include_context "acceptance"
  it_behaves_like "a command that requires a Vagrantfile", ["vagrant", "destroy"]

  it "succeeds and ignores if the VM is not created" do
    require_box("default")

    assert_execute("vagrant", "box", "add", "base", box_path("default"))
    assert_execute("vagrant", "init")

    result = assert_execute("vagrant", "destroy")
    result.stdout.should match_output(:vm_not_created_warning)
  end

  it "is able to destroy a running virtual machine" do
    require_box("default")

    assert_execute("vagrant", "box", "add", "base", box_path("default"))
    assert_execute("vagrant", "init")
    assert_execute("vagrant", "up")

    # Destroy the VM and assert that it worked properly (seemingly)
    result = assert_execute("vagrant", "destroy")
    result.stdout.should match_output(:vm_destroyed)

    # Assert that the VM no longer is created
    result = assert_execute("vagrant", "status")
    result.stdout.should match_output(:status, "default", "not created")
  end

  # TODO:
  # it is able to destroy a halted virtual machine
  # it is able to destroy a suspended virtual machine
end

Version data entries

59 entries across 59 versions & 11 rubygems

Version Path
tamtam-vagrant-reload-1.1.3 vendor/cache/vagrant-0ac2a8738841/test/acceptance/destroy_test.rb
tamtam-vagrant-reload-1.1.2 vendor/cache/vagrant-0ac2a8738841/test/acceptance/destroy_test.rb
tamtam-vagrant-reload-1.1.1 vendor/cache/vagrant-0ac2a8738841/test/acceptance/destroy_test.rb
tamtam-vagrant-reload-1.1 vendor/cache/vagrant-0ac2a8738841/test/acceptance/destroy_test.rb
bmhatfield-vagrant-1.0.10 test/acceptance/destroy_test.rb
bmhatfield-vagrant-1.0.9 test/acceptance/destroy_test.rb
tnargav-1.3.6 test/acceptance/destroy_test.rb
tnargav-1.3.3 test/acceptance/destroy_test.rb
bmhatfield-vagrant-1.0.8 test/acceptance/destroy_test.rb
vagrant-shell-0.2.9 demo/templates/vendor/bundle/ruby/1.9.1/gems/tnargav-1.2.2/test/acceptance/destroy_test.rb
tnargav-1.2.3 test/acceptance/destroy_test.rb
vagrant-shell-0.2.8 demo/templates/vendor/bundle/ruby/1.9.1/gems/tnargav-1.2.2/test/acceptance/destroy_test.rb
bmhatfield-vagrant-1.0.7 test/acceptance/destroy_test.rb
vagrant-shell-0.2.6 vendor/bundle/gems/tnargav-1.2.2/test/acceptance/destroy_test.rb
vagrant-shell-0.2.5 vendor/bundle/gems/tnargav-1.2.2/test/acceptance/destroy_test.rb
tnargav-1.2.2 test/acceptance/destroy_test.rb
vagrantup-1.1.3 test/acceptance/destroy_test.rb
vagrantup-1.1.2 test/acceptance/destroy_test.rb
vagrantup-1.1.1 test/acceptance/destroy_test.rb
vagrantup-1.1.0 test/acceptance/destroy_test.rb