From 52a464a62cf087236afe1df7ffe7b8bcc89d9c85 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Fri, 13 Jan 2012 00:07:23 -0800 Subject: [PATCH] Push a failing acceptance test as a reminder of a missing feature --- test/acceptance/package_test.rb | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/test/acceptance/package_test.rb b/test/acceptance/package_test.rb index 3ba005b74..c247e39c7 100644 --- a/test/acceptance/package_test.rb +++ b/test/acceptance/package_test.rb @@ -3,7 +3,6 @@ require "acceptance/support/shared/command_examples" describe "vagrant package" do include_context "acceptance" - it_behaves_like "a command that requires a Vagrantfile", ["vagrant", "package"] # This creates an initial environment that is ready for a "vagrant up" def initialize_valid_environment @@ -20,4 +19,28 @@ describe "vagrant package" do assert_execute("vagrant", "package") environment.workdir.join("package.box").should be_file end + + it "can package a `base` VM directly from VirtualBox" do + initialize_valid_environment + + # Use a custom Vagrantfile that sets the VM name to `foo` + environment.workdir.join("Vagrantfile").open("w+") do |f| + f.write(<<-vf) +Vagrant::Config.run do |config| + config.vm.box = "base" + config.vm.customize ["modifyvm", :id, "--name", "foo"] +end +vf + end + + # Bring up the VM + assert_execute("vagrant", "up") + + # Remove the Vagrantfile so it doesn't use that + environment.workdir.join("Vagrantfile").unlink + + # Now package the base VM + assert_execute("vagrant", "package", "--base", "foo") + environment.workdir.join("package.box").should be_file + end end