mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-29 22:29:56 +02:00
@@ -25,8 +25,8 @@ import (
|
||||
|
||||
func TestPageMatcher(t *testing.T) {
|
||||
c := qt.New(t)
|
||||
developmentTestSite := testSite{h: hugo.NewInfo("development", nil)}
|
||||
productionTestSite := testSite{h: hugo.NewInfo("production", nil)}
|
||||
developmentTestSite := testSite{h: hugo.NewInfo(testConfig{environment: "development"}, nil)}
|
||||
productionTestSite := testSite{h: hugo.NewInfo(testConfig{environment: "production"}, nil)}
|
||||
|
||||
p1, p2, p3 :=
|
||||
&testPage{path: "/p1", kind: "section", lang: "en", site: developmentTestSite},
|
||||
@@ -156,3 +156,16 @@ func TestDecodeCascadeConfig(t *testing.T) {
|
||||
c.Assert(got, qt.IsNotNil)
|
||||
|
||||
}
|
||||
|
||||
type testConfig struct {
|
||||
environment string
|
||||
workingDir string
|
||||
}
|
||||
|
||||
func (c testConfig) Environment() string {
|
||||
return c.environment
|
||||
}
|
||||
|
||||
func (c testConfig) WorkingDir() string {
|
||||
return c.workingDir
|
||||
}
|
||||
|
@@ -444,9 +444,9 @@ func (s testSite) Param(key any) (any, error) {
|
||||
}
|
||||
|
||||
// NewDummyHugoSite creates a new minimal test site.
|
||||
func NewDummyHugoSite(cfg config.Provider) Site {
|
||||
func NewDummyHugoSite(conf config.AllProvider) Site {
|
||||
return testSite{
|
||||
h: hugo.NewInfo(hugo.EnvironmentProduction, nil),
|
||||
h: hugo.NewInfo(conf, nil),
|
||||
l: &langs.Language{
|
||||
Lang: "en",
|
||||
},
|
||||
|
Reference in New Issue
Block a user