diff options
| author | Paul Buetow <paul@buetow.org> | 2026-03-28 09:12:03 +0200 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-03-28 09:12:03 +0200 |
| commit | 1615abaacccdbb5002404a77270fd333ce8ad718 (patch) | |
| tree | c84cde36805a8717d21504cf954cffc72a2f1181 /internal/config/config_test.go | |
| parent | a694dd751eb16d47b0956facd5594ef575c9dce4 (diff) | |
feat(showcase): support per-repo stats branchesv0.16.0
Diffstat (limited to 'internal/config/config_test.go')
| -rw-r--r-- | internal/config/config_test.go | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/internal/config/config_test.go b/internal/config/config_test.go new file mode 100644 index 0000000..db70457 --- /dev/null +++ b/internal/config/config_test.go @@ -0,0 +1,27 @@ +package config + +import ( + "strings" + "testing" +) + +func TestValidate_ShowcaseStatsBranchesRejectsEmptyBranch(t *testing.T) { + t.Parallel() + + cfg := &Config{ + Organizations: []Organization{ + {Host: "git@github.com", Name: "test-user"}, + }, + ShowcaseStatsBranches: map[string]string{ + "foo.zone": " ", + }, + } + + err := cfg.Validate() + if err == nil { + t.Fatal("Validate() error = nil, want branch validation error") + } + if !strings.Contains(err.Error(), "showcase_stats_branches") { + t.Fatalf("Validate() error = %q, want showcase_stats_branches context", err) + } +} |
