feat(canonical): load YAML/markdown into Bundle

This commit is contained in:
2026-05-23 02:43:56 +01:00
parent eefff1baac
commit e4719b78a0
9 changed files with 242 additions and 1 deletions
+35
View File
@@ -0,0 +1,35 @@
package canonical
import (
"testing"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
func TestLoad(t *testing.T) {
b, err := Load("testdata/sample")
require.NoError(t, err)
assert.Equal(t, "home", b.Config.ActiveProfile)
assert.Equal(t, []string{"claude-code", "crush"}, b.Config.EnabledHarnesses)
assert.Equal(t, "home", b.Profile.Name)
assert.Equal(t, "https://gw.lan", b.Profile.Gateway.URL)
require.Len(t, b.MCP.Servers, 1)
assert.Equal(t, "filepuff", b.MCP.Servers[0].Name)
require.Len(t, b.Skills, 1)
assert.Equal(t, "hello", b.Skills[0].Name)
require.Len(t, b.Agents, 1)
assert.Equal(t, "sample", b.Agents[0].Name)
assert.Contains(t, b.Instructions.Global, "Be helpful.")
}
func TestLoadMissingProfile(t *testing.T) {
_, err := Load("testdata/missing")
assert.Error(t, err)
}