1
0
mirror of https://github.com/danog/gojekyll.git synced 2024-11-30 07:08:59 +01:00
gojekyll/plugins/gist_test.go
2017-07-08 19:57:41 -04:00

22 lines
550 B
Go

package plugins
import (
"regexp"
"testing"
"github.com/osteele/liquid"
"github.com/stretchr/testify/require"
)
func TestGistTag(t *testing.T) {
engine := liquid.NewEngine()
bindings := map[string]interface{}{}
Install("jekyll-gist", train{engine})
s, err := engine.ParseAndRenderString(`{% gist parkr/931c1c8d465a04042403 %}`, bindings)
require.NoError(t, err)
re := regexp.MustCompile(`<script.*>\s*</script>`)
require.Contains(t, s, `src=https://gist.github.com/parkr/931c1c8d465a04042403.js`)
require.True(t, re.MatchString(s))
}