diff options
author | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2016-07-26 10:24:27 +0200 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2016-09-06 18:32:16 +0300 |
commit | 75dd596e6c38466fcb97a8b9dc9eb20fc2fb7fd6 (patch) | |
tree | 37f43d8af433033996fbae9d2b3914888144c60a /hugolib/pagination_test.go | |
parent | 618948e4a83665f8355b01d8a3f7a7186e6bd3eb (diff) |
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.
Diffstat (limited to 'hugolib/pagination_test.go')
-rw-r--r-- | hugolib/pagination_test.go | 14 |
1 files changed, 7 insertions, 7 deletions
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() |