Skip to content

Commit

Permalink
Fix TestWriteDefaultConfig with -count 2
Browse files Browse the repository at this point in the history
I forgot to clear the environment, which means that the test may fail if
the dev's environment isn't what we expect. Even worse, it makes
subsequent runs of the same test fail:

	$ go test -run TestWriteDefaultConf -count 2
	--- FAIL: TestWriteDefaultConf (0.00s)
		config_test.go:12: Expected ListenPort to be set to its default
  • Loading branch information
mvdan authored and buger committed Feb 2, 2017
1 parent 861fae6 commit f8135b6
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (

func TestWriteDefaultConf(t *testing.T) {
conf := &Config{}
os.Unsetenv("TYK_GW_LISTENPORT")
WriteDefaultConf(conf)
if conf.ListenPort != 8080 {
t.Error("Expected ListenPort to be set to its default")
Expand Down

0 comments on commit f8135b6

Please sign in to comment.