summaryrefslogtreecommitdiffstats
path: root/resources
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2024-01-28 22:11:05 +0100
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2024-01-28 22:17:22 +0100
commit982d9513e71b3d48e20cfa38454a0e1215a8d963 (patch)
tree47ece9af143bfbd52fa0e5174f9349b8c04c3211 /resources
parent6dedb4efc7b6a9fbe58a2daf0f77182638840fd9 (diff)
testing: Simplify some integration tests
Diffstat (limited to 'resources')
-rw-r--r--resources/page/page_integration_test.go9
-rw-r--r--resources/resource_transformers/templates/templates_integration_test.go6
-rw-r--r--resources/resources_integration_test.go6
3 files changed, 3 insertions, 18 deletions
diff --git a/resources/page/page_integration_test.go b/resources/page/page_integration_test.go
index 0761de249..763499113 100644
--- a/resources/page/page_integration_test.go
+++ b/resources/page/page_integration_test.go
@@ -20,7 +20,6 @@ import (
)
func TestGroupByLocalizedDate(t *testing.T) {
-
files := `
-- config.toml --
defaultContentLanguage = 'en'
@@ -72,7 +71,6 @@ date: "2020-02-01"
}
func TestPagesSortCollation(t *testing.T) {
-
files := `
-- config.toml --
defaultContentLanguage = 'en'
@@ -166,12 +164,7 @@ RelPermalink: {{ .RelPermalink }}
`
- b := hugolib.NewIntegrationTestBuilder(
- hugolib.IntegrationTestConfig{
- T: t,
- TxtarString: files,
- }).Build()
+ b := hugolib.Test(t, files)
b.AssertFileContent("public/a/c/d/index.html", "RelPermalink: /a/c/d/")
-
}
diff --git a/resources/resource_transformers/templates/templates_integration_test.go b/resources/resource_transformers/templates/templates_integration_test.go
index 4eaac8e27..969e09c36 100644
--- a/resources/resource_transformers/templates/templates_integration_test.go
+++ b/resources/resource_transformers/templates/templates_integration_test.go
@@ -59,11 +59,7 @@ LangURL: {{ relLangURL "foo" }}
`
- b := hugolib.NewIntegrationTestBuilder(
- hugolib.IntegrationTestConfig{
- T: t,
- TxtarString: files,
- }).Build()
+ b := hugolib.Test(t, files)
b.AssertFileContent("public/en/index.html", `
Hello1: Hello
diff --git a/resources/resources_integration_test.go b/resources/resources_integration_test.go
index 9540b0976..a0b35196a 100644
--- a/resources/resources_integration_test.go
+++ b/resources/resources_integration_test.go
@@ -156,11 +156,7 @@ resize 2|RelPermalink: {{ $image.RelPermalink }}|MediaType: {{ $image.MediaType
`
- b := hugolib.NewIntegrationTestBuilder(
- hugolib.IntegrationTestConfig{
- T: t,
- TxtarString: files,
- }).Build()
+ b := hugolib.Test(t, files)
b.AssertFileContent("public/index.html",
"jpg|RelPermalink: /images/pixel_hu8aa3346827e49d756ff4e630147c42b5_70_filter_17010532266664966692.jpg|MediaType: image/jpeg|Width: 1|Height: 1|",