Skip to content

Commit

Permalink
simplify test
Browse files Browse the repository at this point in the history
  • Loading branch information
JeremyLoy committed Nov 3, 2019
1 parent 681e623 commit bbed74e
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,6 @@ func Test_Integration(t *testing.T) {
}
defer os.Remove(file.Name())

nonExistFile, err := ioutil.TempFile("", "nonexistfile")
if err != nil {
t.Fatalf("failed to create temporary file: %v", err)
}
os.Remove(nonExistFile.Name())

testData := strings.Join([]string{
"A=1",
"B=abc",
Expand Down Expand Up @@ -80,9 +74,9 @@ func Test_Integration(t *testing.T) {
I: "",
K: "hardcoded",
}
wantFailedFields := []string{"file[" + nonExistFile.Name() + "]", "g[1]", "h"}
wantFailedFields := []string{"file[nonexistfile]", "g[1]", "h"}

builder := From(file.Name()).From(nonExistFile.Name()).FromEnv()
builder := From(file.Name()).From("nonexistfile").FromEnv()
gotErr := builder.To(&got)
if !reflect.DeepEqual(got, want) {
t.Errorf("Integration: got %+v, want %+v", got, want)
Expand Down

0 comments on commit bbed74e

Please sign in to comment.