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.
24 lines
734 B
Ruby
24 lines
734 B
Ruby
require File.expand_path("../base", __FILE__)
|
|
|
|
describe "vagrant version" do
|
|
include_context "acceptance"
|
|
|
|
it "prints the version to stdout" do
|
|
result = execute("vagrant", "version")
|
|
assert(output(result.stdout).is_version?(config.vagrant_version),
|
|
"output should be version")
|
|
end
|
|
|
|
it "prints the version when called with '-v'" do
|
|
result = execute("vagrant", "-v")
|
|
assert(output(result.stdout).is_version?(config.vagrant_version),
|
|
"output should be version")
|
|
end
|
|
|
|
it "prints the version when called with '--version'" do
|
|
result = execute("vagrant", "--version")
|
|
assert(output(result.stdout).is_version?(config.vagrant_version),
|
|
"output should be version")
|
|
end
|
|
end
|