Skip to content

Commit

Permalink
Add a file not found test to UpdateFile()
Browse files Browse the repository at this point in the history
  • Loading branch information
minamijoyo committed Sep 17, 2019
1 parent 57f6087 commit ed76388
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tfupdate/file_test.go
Expand Up @@ -74,3 +74,15 @@ terraform {
}
}
}

func TestUpdateFileNotFound(t *testing.T) {
fs := afero.NewMemMapFs()
filename := "not_found.tf"
o := Option{}

err := UpdateFile(fs, filename, o)

if err == nil {
t.Errorf("UpdateFile() with filename = %s, o = %#v expects to return an error, but no error", filename, o)
}
}

0 comments on commit ed76388

Please sign in to comment.