From ed76388cc7705b5f01b2c4619e00488af30ba99a Mon Sep 17 00:00:00 2001 From: Masayuki Morita Date: Tue, 17 Sep 2019 23:25:01 +0900 Subject: [PATCH] Add a file not found test to UpdateFile() --- tfupdate/file_test.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tfupdate/file_test.go b/tfupdate/file_test.go index e5f9a3d..d1efe25 100644 --- a/tfupdate/file_test.go +++ b/tfupdate/file_test.go @@ -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) + } +}