2026-02-10 15:27:53 +00:00
|
|
|
package bugseti
|
|
|
|
|
|
|
|
|
|
import (
|
2026-02-13 20:55:39 +00:00
|
|
|
"os"
|
2026-02-10 15:27:53 +00:00
|
|
|
"testing"
|
|
|
|
|
)
|
|
|
|
|
|
2026-02-13 20:55:39 +00:00
|
|
|
func TestCheckForge_Bad_MissingConfig(t *testing.T) {
|
|
|
|
|
// Clear any env-based forge config to ensure CheckForge fails
|
|
|
|
|
t.Setenv("FORGE_TOKEN", "")
|
|
|
|
|
t.Setenv("FORGE_URL", "")
|
2026-02-10 15:27:53 +00:00
|
|
|
|
2026-02-13 20:55:39 +00:00
|
|
|
// Point HOME to a temp dir so no config file is found
|
|
|
|
|
t.Setenv("HOME", t.TempDir())
|
|
|
|
|
if xdg := os.Getenv("XDG_CONFIG_HOME"); xdg != "" {
|
|
|
|
|
t.Setenv("XDG_CONFIG_HOME", t.TempDir())
|
2026-02-10 15:27:53 +00:00
|
|
|
}
|
|
|
|
|
|
2026-02-13 20:55:39 +00:00
|
|
|
_, err := CheckForge()
|
2026-02-10 15:27:53 +00:00
|
|
|
if err == nil {
|
2026-02-13 20:55:39 +00:00
|
|
|
t.Fatal("expected error when forge is not configured")
|
2026-02-10 15:27:53 +00:00
|
|
|
}
|
|
|
|
|
}
|