From bac87f24788f1855e87d4ac6c70d994f1fe56fbf Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Mon, 21 Nov 2011 22:09:51 -0800 Subject: [PATCH] Complete the test (still failing) --- test/acceptance/support/output.rb | 6 ++++-- test/acceptance/up_with_box_url.rb | 4 ++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/test/acceptance/support/output.rb b/test/acceptance/support/output.rb index 1e3bf1aaa..79fb292cf 100644 --- a/test/acceptance/support/output.rb +++ b/test/acceptance/support/output.rb @@ -2,6 +2,8 @@ module Acceptance # This class helps with matching against output so that every # test isn't inherently tied to the output format of Vagrant. class Output + DEFAULT_VM = "default" + def initialize(text) @text = text end @@ -63,8 +65,8 @@ module Acceptance # This checks that the "up" output properly contains text showing that # it is downloading the box during the up process. - def up_fetching_box(name) - @text =~ /Box #{name} was not found. Fetching box from specified URL...$/ + def up_fetching_box(name, vm=DEFAULT_VM) + @text =~ /^[#{vm}] Box #{name} was not found. Fetching box from specified URL...$/ end end end diff --git a/test/acceptance/up_with_box_url.rb b/test/acceptance/up_with_box_url.rb index cb3b78be7..37c3f962d 100644 --- a/test/acceptance/up_with_box_url.rb +++ b/test/acceptance/up_with_box_url.rb @@ -31,6 +31,10 @@ end VFILE end + # Bring up the environment, which should work. `machine1` should download + # the box while `machine2` doesn't. result = assert_execute("vagrant", "up") + result.stdout.should match_output(:up_fetching_box, "base", "machine1") + result.stdout.should_not match_output(:up_fetching_box, "base", "machine2") end end