Permalink
Browse files

Test that `vagrant up` works if Vagrantfile is in a parent directory

  • Loading branch information...
1 parent f0aa19f commit 60a350f9c7cf5ae48387f7114879d372477fa0ea @mitchellh mitchellh committed Nov 11, 2011
Showing with 15 additions and 3 deletions.
  1. +5 −2 test/acceptance/support/isolated_environment.rb
  2. +10 −1 test/acceptance/up_basic_test.rb
@@ -54,8 +54,11 @@ def initialize(apps=nil, env=nil)
def execute(command, *argN)
command = replace_command(command)
- # Add our hash options to the arguments list
- argN << { :chdir => @workdir.to_s }
+ # Setup the options that will be passed to the ``popen4``
+ # method.
+ argN << {} if !argN.last.is_a?(Hash)
+ options = argN.last
+ options[:chdir] ||= @workdir.to_s
# Execute in a separate process, wait for it to complete, and
# return the IO streams.
@@ -19,6 +19,16 @@ def initialize_valid_environment
result.stdout.should match_output(:status, "default", "running")
end
+ it "is able to run if Vagrantfile is in a parent directory" do
+ initialize_valid_environment
+
+ # Create a subdirectory in the working directory and use
+ # that as the CWD for `vagrant up` and verify it still works
+ foodir = environment.workdir.join("foo")
+ foodir.mkdir
+ assert_execute("vagrant", "up", :chdir => foodir.to_s)
+ end
+
it "should have a '/vagrant' shared folder" do
initialize_valid_environment
@@ -38,7 +48,6 @@ def initialize_valid_environment
TODO:
- should "be able to run if `Vagrantfile` is in parent directory"
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`"

0 comments on commit 60a350f

Please sign in to comment.