test builds can be 'excepted'

This commit is contained in:
Adrien Delorme 2020-07-07 11:41:24 +02:00
parent c1c8b8d22a
commit a15ad19411
2 changed files with 32 additions and 2 deletions

View File

@ -28,6 +28,11 @@ carbonara
tomato tomato
mozza mozza
cooking... cooking...
`
tiramisu = `whip_york
mascarpone
whipped_egg_white
dress
` `
) )
@ -254,6 +259,7 @@ func TestBuild(t *testing.T) {
expectedContent: map[string]string{ expectedContent: map[string]string{
"NULL.spaghetti_carbonara.txt": spaghettiCarbonara, "NULL.spaghetti_carbonara.txt": spaghettiCarbonara,
"NULL.lasagna.txt": lasagna, "NULL.lasagna.txt": lasagna,
"NULL.tiramisu.txt": tiramisu,
}, },
}, },
}, },
@ -267,7 +273,8 @@ func TestBuild(t *testing.T) {
fileCheck: fileCheck{ fileCheck: fileCheck{
notExpected: []string{"NULL.spaghetti_carbonara.txt"}, notExpected: []string{"NULL.spaghetti_carbonara.txt"},
expectedContent: map[string]string{ expectedContent: map[string]string{
"NULL.lasagna.txt": lasagna, "NULL.lasagna.txt": lasagna,
"NULL.tiramisu.txt": tiramisu,
}, },
}, },
}, },
@ -279,7 +286,10 @@ func TestBuild(t *testing.T) {
testFixture("hcl", "recipes"), testFixture("hcl", "recipes"),
}, },
fileCheck: fileCheck{ fileCheck: fileCheck{
notExpected: []string{"NULL.spaghetti_carbonara.txt"}, notExpected: []string{
"NULL.spaghetti_carbonara.txt",
"NULL.tiramisu.txt",
},
expectedContent: map[string]string{ expectedContent: map[string]string{
"NULL.lasagna.txt": lasagna, "NULL.lasagna.txt": lasagna,
}, },
@ -293,6 +303,9 @@ func TestBuild(t *testing.T) {
testFixture("hcl", "recipes"), testFixture("hcl", "recipes"),
}, },
fileCheck: fileCheck{ fileCheck: fileCheck{
notExpected: []string{
"NULL.tiramisu.txt",
},
expectedContent: map[string]string{ expectedContent: map[string]string{
"NULL.spaghetti_carbonara.txt": spaghettiCarbonara, "NULL.spaghetti_carbonara.txt": spaghettiCarbonara,
"NULL.lasagna.txt": lasagna, "NULL.lasagna.txt": lasagna,

View File

@ -3,6 +3,23 @@ build {
source "source.null.base" { source "source.null.base" {
name = "tiramisu" name = "tiramisu"
} }
provisioner "shell-local" {
name = "whipped_york"
inline = [ "echo whip_york > ${upper(build.ID)}.${source.name}.txt" ]
}
provisioner "shell-local" {
name = "mascarpone"
inline = [ "echo mascarpone >> ${upper(build.ID)}.${source.name}.txt" ]
}
post-processor "shell-local" {
name = "whipped_egg_white"
inline = [ "echo whipped_egg_white >> ${upper(build.ID)}.${source.name}.txt" ]
}
post-processor "shell-local" {
name = "dress_with_coffeed_boudoirs"
inline = [ "echo dress >> ${upper(build.ID)}.${source.name}.txt" ]
}
} }
build { build {