guildhouse-spire-plugins/pkg/config/config_test.go

21 lines
402 B
Go

package config
import (
"testing"
)
func TestValidateRequiresTrustDomain(t *testing.T) {
cfg := &PluginConfig{}
err := cfg.Validate()
if err == nil {
t.Fatal("expected error for empty trust domain")
}
}
func TestValidateAcceptsMinimalConfig(t *testing.T) {
cfg := &PluginConfig{TrustDomain: "example.org"}
err := cfg.Validate()
if err != nil {
t.Fatalf("unexpected error: %v", err)
}
}