From 19f3a63ee1cb0ee97ac965d15a3f50292f1e7a4b Mon Sep 17 00:00:00 2001 From: DanHam Date: Mon, 5 Aug 2019 18:30:39 +0100 Subject: [PATCH] Tests: Should not error when template is to be created during build --- post-processor/vagrant/post-processor_test.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/post-processor/vagrant/post-processor_test.go b/post-processor/vagrant/post-processor_test.go index 372e1da68..fccf4cf24 100644 --- a/post-processor/vagrant/post-processor_test.go +++ b/post-processor/vagrant/post-processor_test.go @@ -148,7 +148,14 @@ func TestPostProcessorPrepare_vagrantfileTemplateExists(t *testing.T) { } if err := p.Configure(c); err == nil { - t.Fatal("expected an error since vagrantfile_template does not exist") + t.Fatal("expected error since vagrantfile_template does not exist and vagrantfile_template_generated is unset") + } + + // The vagrantfile_template will be generated during the build process + c["vagrantfile_template_generated"] = true + + if err := p.Configure(c); err != nil { + t.Fatal("no error expected due to missing vagrantfile_template as vagrantfile_template_generated is set") } }