MCPcopy Create free account
hub / github.com/basecamp/hey-cli / TestDefaultConfig

Function TestDefaultConfig

internal/config/config_test.go:10–26  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

8)
9
10func TestDefaultConfig(t *testing.T) {
11 tmp := t.TempDir()
12 t.Setenv("XDG_CONFIG_HOME", tmp)
13 t.Setenv("HEY_BASE_URL", "")
14
15 cfg, err := Load()
16 if err != nil {
17 t.Fatalf("Load: %v", err)
18 }
19
20 if cfg.BaseURL != defaultBase {
21 t.Errorf("BaseURL = %q, want %q", cfg.BaseURL, defaultBase)
22 }
23 if src := cfg.SourceOf("base_url"); src != SourceDefault {
24 t.Errorf("source = %q, want %q", src, SourceDefault)
25 }
26}
27
28func TestGlobalConfigOverride(t *testing.T) {
29 tmp := t.TempDir()

Callers

nothing calls this directly

Calls 2

LoadFunction · 0.85
SourceOfMethod · 0.80

Tested by

no test coverage detected