file_test.go
592 bytes
1package config
2
3import (
4 "strings"
5 "testing"
6)
7
8func TestNewConfigFile(t *testing.T) {
9 for _, cfg := range []*Config{
10 nil,
11 DefaultConfig(),
12 {},
13 } {
14 if s := newConfigFile(cfg); s == "" {
15 t.Errorf("newConfigFile(nil) => %q, want non-empty string", s)
16 }
17 }
18}
19
20func TestNewConfigFileIncludesWebUI(t *testing.T) {
21 if s := newConfigFile(DefaultConfig()); !strings.Contains(s, "web_ui:\n enabled: false\n\n # Internal worker URL used for current build status badges.\n build_status_url: \"\"") {
22 t.Errorf("generated config does not include web_ui settings: %q", s)
23 }
24}