RSpec was chosen to be used for acceptance tests for many reasons: * The tests are actually much cleaner now. It is clearer to see what is being tested, and what is being used for setup. * Matcher transition will be coming soon. This will really clean up a lot of the "assert" boilerplate all over. There was a lot of repetition in this area. * Shared examples will help greatly for testing common error cases for many commands. * The test runner for RSpec is simply much better. Being able to specify the exact test to run by line, for example, is a great help.
33 lines
1.0 KiB
Ruby
33 lines
1.0 KiB
Ruby
require File.expand_path("../base", __FILE__)
|
|
|
|
describe "vagrant up", "basics" do
|
|
it "fails if not Vagrantfile is found" do
|
|
result = execute("vagrant", "up")
|
|
assert(!result.success?, "vagrant up should fail")
|
|
assert(output(result.stdout).no_vagrantfile,
|
|
"Vagrant should error since there is no Vagrantfile")
|
|
end
|
|
|
|
it "brings up a running virtual machine" do
|
|
assert_execute("vagrant", "box", "add", "base", config.boxes["default"])
|
|
assert_execute("vagrant", "init")
|
|
assert_execute("vagrant", "up")
|
|
result = assert_execute("vagrant", "status")
|
|
|
|
assert(output(result.stdout).status("default", "running"),
|
|
"Virtual machine should be running")
|
|
end
|
|
|
|
=begin
|
|
|
|
TODO:
|
|
|
|
should "be able to run if `Vagrantfile` is in parent directory"
|
|
should "bring up a running virtual machine and have a `/vagrant' shared folder by default"
|
|
should "destroy a running virtual machine"
|
|
should "save then restore a virtual machine using `vagrant up`"
|
|
should "halt then start a virtual machine using `vagrant up`"
|
|
|
|
=end
|
|
end
|