aboutsummaryrefslogtreecommitdiffhomepage
path: root/hugolib/hugo_sites_build_test.go
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <[email protected]>2021-10-20 10:11:48 +0200
committerBjørn Erik Pedersen <[email protected]>2022-04-05 18:00:44 +0200
commite58a540895c28b8884823dcb1b64c272422f9923 (patch)
tree3fefb267f87e61a969a6ccf776d75fe64b50b2b1 /hugolib/hugo_sites_build_test.go
parent20162518c450770ebfd54e0e987f34a5cccf236b (diff)
downloadhugo-e58a540895c28b8884823dcb1b64c272422f9923.tar.gz
hugo-e58a540895c28b8884823dcb1b64c272422f9923.zip
resources: Create a common ResourceFinder interface
And make both .Resources and resources implement it. This gets us 2 new methods/functions, so you can now also do: * .Resources.Get * resources.ByType Note that GetRemote is not covered by this interface, as that is only available as a global template function. Fixes #8653
Diffstat (limited to 'hugolib/hugo_sites_build_test.go')
-rw-r--r--hugolib/hugo_sites_build_test.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/hugolib/hugo_sites_build_test.go b/hugolib/hugo_sites_build_test.go
index cdd7b8054..d71e7c7a4 100644
--- a/hugolib/hugo_sites_build_test.go
+++ b/hugolib/hugo_sites_build_test.go
@@ -397,6 +397,8 @@ func doTestMultiSitesBuild(t *testing.T, configTemplate, configSuffix string) {
c.Assert(bundleFr, qt.Not(qt.IsNil))
c.Assert(len(bundleFr.Resources()), qt.Equals, 1)
logoFr := bundleFr.Resources().GetMatch("logo*")
+ logoFrGet := bundleFr.Resources().Get("logo.png")
+ c.Assert(logoFrGet, qt.Equals, logoFr)
c.Assert(logoFr, qt.Not(qt.IsNil))
b.AssertFileContent("public/fr/bundles/b1/index.html", "Resources: image/png: /blog/fr/bundles/b1/logo.png")
b.AssertFileContent("public/fr/bundles/b1/logo.png", "PNG Data")