vagrant/test/acceptance/box_test.rb

23 lines
832 B
Ruby
Raw Normal View History

2011-11-03 04:42:09 +00:00
require File.expand_path("../base", __FILE__)
class BoxTest < AcceptanceTest
should "have no boxes by default" do
result = execute("vagrant", "box", "list")
assert result.stdout.read =~ /There are no installed boxes!/
end
2011-11-04 04:38:15 +00:00
should "add a box from a file" do
if !config.boxes.has_key?("default") || !File.file?(config.boxes["default"])
raise ArgumentError, "The configuration should specify a 'default' box."
end
# Add the box, which we expect to succeed
results = execute("vagrant", "box", "add", "foo", config.boxes["default"])
assert(results.success?, "Box add should succeed.")
# Verify that the box now shows up in the list of available boxes
results = execute("vagrant", "box", "list")
assert(results.stdout.read =~ /^foo$/, "Box should exist after it is added")
end
2011-11-03 04:42:09 +00:00
end