package filter

import (
	"testing"

	"github.com/davecgh/go-spew/spew"

	"github.com/flosch/pongo2"

	. "github.com/smartystreets/goconvey/convey"
)

func TestDumpFilter(t *testing.T) {
	Convey("set context", t, func() {
		ctx := pongo2.Context{
			"testvar": "test",
		}
		Convey("parse template", func() {
			output, err := pongo2.RenderTemplateString("{{ testvar|safe|dump }}", ctx)
			So(err, ShouldBeNil)
			So(output, ShouldEqual, spew.Sdump("test"))
		})
	})
}
