mirror of
https://github.com/danog/gojekyll.git
synced 2024-12-03 14:17:47 +01:00
21 lines
553 B
Go
21 lines
553 B
Go
package pages
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/osteele/gojekyll/config"
|
|
"github.com/osteele/liquid"
|
|
"github.com/stretchr/testify/require"
|
|
)
|
|
|
|
func TestPage_ToLiquid(t *testing.T) {
|
|
cfg := config.Default()
|
|
page, err := NewFile(siteFake{t, cfg}, "testdata/excerpt.md", "excerpt.md", map[string]interface{}{})
|
|
require.NoError(t, err)
|
|
drop := page.(liquid.Drop).ToLiquid()
|
|
excerpt := drop.(map[string]interface{})["excerpt"]
|
|
// FIXME the following probably isn't right
|
|
// TODO also test post-rendering.
|
|
require.Equal(t, "First line.", excerpt)
|
|
}
|