From 0da8fc69981bc6aface583c635f60e9f7d34ec0c Mon Sep 17 00:00:00 2001 From: Slug-Boi Date: Tue, 3 Jun 2025 19:59:00 +0200 Subject: [PATCH] fix: env var test updated for panic --- src/cmd/utils/util_test.go | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/cmd/utils/util_test.go b/src/cmd/utils/util_test.go index 4a624d9..888c05a 100644 --- a/src/cmd/utils/util_test.go +++ b/src/cmd/utils/util_test.go @@ -173,14 +173,10 @@ func Test_FindAuthorFileEnv(t *testing.T) { // Test Find_authorfile with env var setup() defer teardown() - os.Setenv("author_file", "") + os.Setenv("author_file", "author_file_test") authorfile := utils.Find_authorfile() - configdir, err := os.UserConfigDir() - if err != nil { - t.Fatalf("Failed to get user config directory: %v", err) - } - if authorfile != configdir+"/cocommit/authors.json" { - t.Errorf("Find_authorfile() = %v; want %v", authorfile, configdir+"/cocommit/authors.json") + if authorfile != "author_file_test" { + t.Errorf("Find_authorfile() = %v; want %v", authorfile, "author_file_test") } }