Test that `vagrant up` also works for resuming

This commit is contained in:
Mitchell Hashimoto 2011-11-24 16:21:21 -07:00
parent f9653bf8d2
commit d03744c5e1
1 changed files with 17 additions and 13 deletions

View File

@ -31,22 +31,26 @@ describe "vagrant suspend" do
result.stdout.should match_output(:status, "default", "saved") result.stdout.should match_output(:status, "default", "saved")
end end
it "is able to resume after the machine has been suspended" do # These tests are parameterized since both "vagrant resume" and
require_box("default") # "vagrant up" should achieve the same result.
["resume", "up"].each do |command|
it "is able to resume after the machine has been suspended using #{command}" do
require_box("default")
assert_execute("vagrant", "box", "add", "base", box_path("default")) assert_execute("vagrant", "box", "add", "base", box_path("default"))
assert_execute("vagrant", "init") assert_execute("vagrant", "init")
assert_execute("vagrant", "up") assert_execute("vagrant", "up")
assert_execute("vagrant", "suspend") assert_execute("vagrant", "suspend")
# Assert that the VM is no longer running # Assert that the VM is no longer running
result = assert_execute("vagrant", "status") result = assert_execute("vagrant", "status")
result.stdout.should match_output(:status, "default", "saved") result.stdout.should match_output(:status, "default", "saved")
assert_execute("vagrant", "resume") assert_execute("vagrant", command)
# Assert that the VM is once again running # Assert that the VM is once again running
result = assert_execute("vagrant", "status") result = assert_execute("vagrant", "status")
result.stdout.should match_output(:status, "default", "running") result.stdout.should match_output(:status, "default", "running")
end
end end
end end