diff options
Diffstat (limited to 'resources/resource_transformers/htesting')
-rw-r--r-- | resources/resource_transformers/htesting/testhelpers.go | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/resources/resource_transformers/htesting/testhelpers.go b/resources/resource_transformers/htesting/testhelpers.go index 3c91fc0dd..75ae4245e 100644 --- a/resources/resource_transformers/htesting/testhelpers.go +++ b/resources/resource_transformers/htesting/testhelpers.go @@ -16,18 +16,16 @@ package htesting import ( "path/filepath" - "github.com/gohugoio/hugo/cache/filecache" "github.com/gohugoio/hugo/config" + "github.com/gohugoio/hugo/config/testconfig" "github.com/gohugoio/hugo/helpers" "github.com/gohugoio/hugo/hugofs" - "github.com/gohugoio/hugo/media" - "github.com/gohugoio/hugo/output" "github.com/gohugoio/hugo/resources" "github.com/spf13/afero" ) func NewTestResourceSpec() (*resources.Spec, error) { - cfg := config.NewWithTestDefaults() + cfg := config.New() imagingCfg := map[string]any{ "resampleFilter": "linear", @@ -36,20 +34,16 @@ func NewTestResourceSpec() (*resources.Spec, error) { } cfg.Set("imaging", imagingCfg) + afs := afero.NewMemMapFs() - fs := hugofs.NewFrom(hugofs.NewBaseFileDecorator(afero.NewMemMapFs()), cfg) - - s, err := helpers.NewPathSpec(fs, cfg, nil) - if err != nil { - return nil, err - } - - filecaches, err := filecache.NewCaches(s) + conf := testconfig.GetTestConfig(afs, cfg) + fs := hugofs.NewFrom(hugofs.NewBaseFileDecorator(afs), conf.BaseConfig()) + s, err := helpers.NewPathSpec(fs, conf, nil) if err != nil { return nil, err } - spec, err := resources.NewSpec(s, filecaches, nil, nil, nil, nil, output.DefaultFormats, media.DefaultTypes) + spec, err := resources.NewSpec(s, nil, nil, nil, nil, nil) return spec, err } |