diff options
Diffstat (limited to 'resources/page/pagemeta/page_frontmatter_test.go')
-rw-r--r-- | resources/page/pagemeta/page_frontmatter_test.go | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/resources/page/pagemeta/page_frontmatter_test.go b/resources/page/pagemeta/page_frontmatter_test.go index 7c4c77a91..6e3833b0f 100644 --- a/resources/page/pagemeta/page_frontmatter_test.go +++ b/resources/page/pagemeta/page_frontmatter_test.go @@ -18,8 +18,9 @@ import ( "testing" "time" + "github.com/gohugoio/hugo/config" + "github.com/gohugoio/hugo/resources/resource" - "github.com/spf13/viper" qt "github.com/frankban/quicktest" ) @@ -72,7 +73,7 @@ func newTestFd() *FrontMatterDescriptor { func TestFrontMatterNewConfig(t *testing.T) { c := qt.New(t) - cfg := viper.New() + cfg := config.New() cfg.Set("frontmatter", map[string]interface{}{ "date": []string{"publishDate", "LastMod"}, @@ -89,7 +90,7 @@ func TestFrontMatterNewConfig(t *testing.T) { c.Assert(fc.publishDate, qt.DeepEquals, []string{"date"}) // Default - cfg = viper.New() + cfg = config.New() fc, err = newFrontmatterConfig(cfg) c.Assert(err, qt.IsNil) c.Assert(fc.date, qt.DeepEquals, []string{"date", "publishdate", "pubdate", "published", "lastmod", "modified"}) @@ -117,7 +118,7 @@ func TestFrontMatterDatesHandlers(t *testing.T) { for _, handlerID := range []string{":filename", ":fileModTime", ":git"} { - cfg := viper.New() + cfg := config.New() cfg.Set("frontmatter", map[string]interface{}{ "date": []string{handlerID, "date"}, @@ -157,7 +158,7 @@ func TestFrontMatterDatesCustomConfig(t *testing.T) { c := qt.New(t) - cfg := viper.New() + cfg := config.New() cfg.Set("frontmatter", map[string]interface{}{ "date": []string{"mydate"}, "lastmod": []string{"publishdate"}, @@ -204,7 +205,7 @@ func TestFrontMatterDatesDefaultKeyword(t *testing.T) { c := qt.New(t) - cfg := viper.New() + cfg := config.New() cfg.Set("frontmatter", map[string]interface{}{ "date": []string{"mydate", ":default"}, |