package plugins import ( "fmt" "regexp" "testing" "github.com/osteele/liquid" "github.com/stretchr/testify/require" ) type train struct{ e liquid.Engine } func (t train) TemplateEngine() liquid.Engine { return t.e } func TestAvatarTag(t *testing.T) { engine := liquid.NewEngine() bindings := map[string]interface{}{"user": "osteele"} Install("jekyll-avatar", train{engine}) s, err := engine.ParseAndRenderString(`{% avatar osteele %}`, bindings) require.NoError(t, err) re := regexp.MustCompile(`\s*`) fmt.Println(s) require.Contains(t, s, `src=https://gist.github.com/parkr/931c1c8d465a04042403.js`) require.True(t, re.MatchString(s)) }