Some godoc adjustments and image struct renames

This commit is contained in:
Bjørn Erik Pedersen 2022-04-21 10:59:13 +02:00
parent 11047534e4
commit fa80fe3c8a
23 changed files with 193 additions and 90 deletions

View file

@ -20,6 +20,7 @@ import (
"github.com/gohugoio/hugo/hugofs"
"github.com/gohugoio/hugo/media"
"github.com/gohugoio/hugo/output"
"github.com/gohugoio/hugo/resources/images"
"github.com/gohugoio/hugo/resources/page"
"github.com/gohugoio/hugo/resources/resource"
"github.com/spf13/afero"
@ -131,19 +132,19 @@ func newTestResourceOsFs(c *qt.C) (*Spec, string) {
return spec, workDir
}
func fetchSunset(c *qt.C) resource.Image {
func fetchSunset(c *qt.C) images.ImageResource {
return fetchImage(c, "sunset.jpg")
}
func fetchImage(c *qt.C, name string) resource.Image {
func fetchImage(c *qt.C, name string) images.ImageResource {
spec := newTestResourceSpec(specDescriptor{c: c})
return fetchImageForSpec(spec, c, name)
}
func fetchImageForSpec(spec *Spec, c *qt.C, name string) resource.Image {
func fetchImageForSpec(spec *Spec, c *qt.C, name string) images.ImageResource {
r := fetchResourceForSpec(spec, c, name)
img := r.(resource.Image)
img := r.(images.ImageResource)
c.Assert(img, qt.Not(qt.IsNil))
c.Assert(img.(specProvider).getSpec(), qt.Not(qt.IsNil))