@@ -111,6 +111,33 @@ func TestBuildOnlyFileMultipleFlags(t *testing.T) {
111111 }
112112}
113113
114+ func TestBuildProvisionAndPosProcessWithBuildVariablesSharing (t * testing.T ) {
115+ c := & BuildCommand {
116+ Meta : testMetaFile (t ),
117+ }
118+
119+ args := []string {
120+ filepath .Join (testFixture ("build-variable-sharing" ), "template.json" ),
121+ }
122+
123+ files := []string {
124+ "provisioner.Null.txt" ,
125+ "post-processor.Null.txt" ,
126+ }
127+
128+ defer cleanup (files ... )
129+
130+ if code := c .Run (args ); code != 0 {
131+ fatalCommand (t , c .Meta )
132+ }
133+
134+ for _ , f := range files {
135+ if ! fileExists (f ) {
136+ t .Errorf ("Expected to find %s" , f )
137+ }
138+ }
139+ }
140+
114141func TestBuildEverything (t * testing.T ) {
115142 c := & BuildCommand {
116143 Meta : testMetaFile (t ),
@@ -231,7 +258,7 @@ func testMetaFile(t *testing.T) Meta {
231258 }
232259}
233260
234- func cleanup () {
261+ func cleanup (moreFiles ... string ) {
235262 os .RemoveAll ("chocolate.txt" )
236263 os .RemoveAll ("vanilla.txt" )
237264 os .RemoveAll ("cherry.txt" )
@@ -245,6 +272,9 @@ func cleanup() {
245272 os .RemoveAll ("lilas.txt" )
246273 os .RemoveAll ("campanules.txt" )
247274 os .RemoveAll ("ducky.txt" )
275+ for _ , file := range moreFiles {
276+ os .RemoveAll (file )
277+ }
248278}
249279
250280func TestBuildCommand_ParseArgs (t * testing.T ) {
0 commit comments