Skip to content

Commit

Permalink
#10 Reset flags for testing
Browse files Browse the repository at this point in the history
  • Loading branch information
kutzilla committed Jan 8, 2022
1 parent 02807d1 commit d89548d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/conf/conf_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@ import (
"testing"

"github.com/stretchr/testify/assert"
"github.com/namsral/flag"
)

func TestReadEnvs(t *testing.T) {
flag.ResetForTesting(nil)
assert := assert.New(t)

os.Setenv(EnvZoneName, "example.com")
Expand All @@ -28,6 +30,7 @@ func TestReadEnvs(t *testing.T) {
}

func TestReadOptionalEnvs(t *testing.T) {
flag.ResetForTesting(nil)
assert := assert.New(t)

os.Setenv(EnvZoneName, "example.com")
Expand All @@ -50,6 +53,7 @@ func TestReadOptionalEnvs(t *testing.T) {
}

func TestAllMissingArgs(t *testing.T) {
flag.ResetForTesting(nil)
assert := assert.New(t)

// No args
Expand All @@ -58,6 +62,7 @@ func TestAllMissingArgs(t *testing.T) {
}

func TestFewMissingArgs(t *testing.T) {
flag.ResetForTesting(nil)
assert := assert.New(t)

// Missing mandatory args
Expand Down

0 comments on commit d89548d

Please sign in to comment.