package pages import ( "path/filepath" "testing" "github.com/osteele/gojekyll/config" "github.com/stretchr/testify/require" ) type containerFake struct { cfg config.Config prefix string } func (c containerFake) Config() *config.Config { return &c.cfg } func (c containerFake) PathPrefix() string { return c.prefix } func (c containerFake) OutputExt(p string) string { return filepath.Ext(p) } func TestPageCategories(t *testing.T) { c := containerFake{config.Default(), ""} fm := map[string]interface{}{"categories": "b a"} f := file{container: c, frontMatter: fm} require.Equal(t, []string{"a", "b"}, f.Categories()) }