Skip to content

Commit d820490

Browse files
author
Matthew Fisher
committed
Merge pull request #3346 from bacongobbler/1817-add-deis-envvar-tests
test(tests/config_test.go): add DEIS_APP and DEIS_RELEASE tests
2 parents 538ff45 + ea765c8 commit d820490

2 files changed

Lines changed: 6 additions & 5 deletions

File tree

tests/config_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ func configSetup(t *testing.T) *utils.DeisTestConfig {
4949
utils.Execute(t, configSetBuildpackCmd, cfg, false, "https://github.com/heroku/heroku-buildpack-go#98f37cc")
5050
utils.Execute(t, gitPushCmd, cfg, false, "")
5151
utils.CurlWithFail(t, cfg, false, "the Deis team")
52+
utils.CheckList(t, "run env --app={{.AppName}}", cfg, "DEIS_APP", false)
53+
utils.CheckList(t, "run env --app={{.AppName}}", cfg, "DEIS_RELEASE", false)
5254
if err := utils.Chdir(".."); err != nil {
5355
t.Fatal(err)
5456
}

tests/utils/itutils.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -196,11 +196,10 @@ func CheckList(
196196
if err != nil {
197197
t.Fatal(err)
198198
}
199-
if strings.Contains(stdout.String(), contain) == notflag {
200-
if notflag {
201-
t.Fatalf(
202-
"Didn't expect '%s' in command output:\n%v", contain, stdout)
203-
}
199+
if notflag && strings.Contains(stdout.String(), contain) {
200+
t.Fatalf("Didn't expect '%s' in command output:\n%v", contain, stdout)
201+
}
202+
if !notflag && !strings.Contains(stdout.String(), contain) {
204203
t.Fatalf("Expected '%s' in command output:\n%v", contain, stdout)
205204
}
206205
}

0 commit comments

Comments
 (0)