mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-17 21:01:26 +02:00
hugolib: Test helper cleanup
This commit is contained in:
@@ -36,7 +36,7 @@ func TestAlias(t *testing.T) {
|
||||
|
||||
var (
|
||||
cfg, fs = newTestCfg()
|
||||
th = testHelper{cfg}
|
||||
th = testHelper{cfg, fs, t}
|
||||
)
|
||||
|
||||
writeSource(t, fs, filepath.Join("content", "page.md"), pageWithAlias)
|
||||
@@ -45,9 +45,9 @@ func TestAlias(t *testing.T) {
|
||||
buildSingleSite(t, deps.DepsCfg{Fs: fs, Cfg: cfg}, BuildCfg{})
|
||||
|
||||
// the real page
|
||||
th.assertFileContent(t, fs, filepath.Join("public", "page", "index.html"), false, "For some moments the old man")
|
||||
th.assertFileContent(filepath.Join("public", "page", "index.html"), false, "For some moments the old man")
|
||||
// the alias redirector
|
||||
th.assertFileContent(t, fs, filepath.Join("public", "foo", "bar", "index.html"), false, "<meta http-equiv=\"refresh\" content=\"0; ")
|
||||
th.assertFileContent(filepath.Join("public", "foo", "bar", "index.html"), false, "<meta http-equiv=\"refresh\" content=\"0; ")
|
||||
}
|
||||
|
||||
func TestAliasTemplate(t *testing.T) {
|
||||
@@ -55,7 +55,7 @@ func TestAliasTemplate(t *testing.T) {
|
||||
|
||||
var (
|
||||
cfg, fs = newTestCfg()
|
||||
th = testHelper{cfg}
|
||||
th = testHelper{cfg, fs, t}
|
||||
)
|
||||
|
||||
writeSource(t, fs, filepath.Join("content", "page.md"), pageWithAlias)
|
||||
@@ -69,7 +69,7 @@ func TestAliasTemplate(t *testing.T) {
|
||||
require.NoError(t, sites.Build(BuildCfg{}))
|
||||
|
||||
// the real page
|
||||
th.assertFileContent(t, fs, filepath.Join("public", "page", "index.html"), false, "For some moments the old man")
|
||||
th.assertFileContent(filepath.Join("public", "page", "index.html"), false, "For some moments the old man")
|
||||
// the alias redirector
|
||||
th.assertFileContent(t, fs, filepath.Join("public", "foo", "bar", "index.html"), false, "ALIASTEMPLATE")
|
||||
th.assertFileContent(filepath.Join("public", "foo", "bar", "index.html"), false, "ALIASTEMPLATE")
|
||||
}
|
||||
|
Reference in New Issue
Block a user