From 75dd596e6c38466fcb97a8b9dc9eb20fc2fb7fd6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Tue, 26 Jul 2016 10:24:27 +0200 Subject: Introduce HugoSites type And a Hugo global variable which contains the site under build. This is really needed to get some level of control of the "multiple languages" in play. There are still work related to this scattered around, but that will come. With this commit, the multilingual feature is starting to work. --- hugolib/pagination_test.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'hugolib/pagination_test.go') diff --git a/hugolib/pagination_test.go b/hugolib/pagination_test.go index 9b311cb34..080e6bee9 100644 --- a/hugolib/pagination_test.go +++ b/hugolib/pagination_test.go @@ -226,7 +226,7 @@ func doTestPaginator(t *testing.T, useViper bool) { viper.Set("paginate", -1) } pages := createTestPages(12) - s := &Site{} + s := newSiteDefaultLang() n1 := s.newHomeNode() n2 := s.newHomeNode() n1.Data["Pages"] = pages @@ -264,7 +264,7 @@ func TestPaginatorWithNegativePaginate(t *testing.T) { defer viper.Reset() viper.Set("paginate", -1) - s := &Site{} + s := newSiteDefaultLang() _, err := s.newHomeNode().Paginator() assert.NotNil(t, err) } @@ -287,7 +287,7 @@ func doTestPaginate(t *testing.T, useViper bool) { } pages := createTestPages(6) - s := &Site{} + s := newSiteDefaultLang() n1 := s.newHomeNode() n2 := s.newHomeNode() @@ -320,7 +320,7 @@ func doTestPaginate(t *testing.T, useViper bool) { } func TestInvalidOptions(t *testing.T) { - s := &Site{} + s := newSiteDefaultLang() n1 := s.newHomeNode() _, err := n1.Paginate(createTestPages(1), 1, 2) assert.NotNil(t, err) @@ -335,7 +335,7 @@ func TestPaginateWithNegativePaginate(t *testing.T) { defer viper.Reset() viper.Set("paginate", -1) - s := &Site{} + s := newSiteDefaultLang() _, err := s.newHomeNode().Paginate(createTestPages(2)) assert.NotNil(t, err) } @@ -358,7 +358,7 @@ func TestPaginatorFollowedByPaginateShouldFail(t *testing.T) { defer viper.Reset() viper.Set("paginate", 10) - s := &Site{} + s := newSiteDefaultLang() n1 := s.newHomeNode() n2 := s.newHomeNode() @@ -377,7 +377,7 @@ func TestPaginateFollowedByDifferentPaginateShouldFail(t *testing.T) { defer viper.Reset() viper.Set("paginate", 10) - s := &Site{} + s := newSiteDefaultLang() n1 := s.newHomeNode() n2 := s.newHomeNode() -- cgit v1.2.3